Different result

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
HenkSiets
Posts: 1
Last visit: Thu May 11, 2017 4:35 am

Different result

Post by HenkSiets »

Hi all,

When I do: get-date -DisplayHint Date in powershell I get only the date back which is correct but when I do the same command in a label field in a form I get the date and time back. What am I doing wrong and how can I solve that?

Thanks in advance.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Different result

Post by jvierra »

because it is not a string it is a datetime object:

"$(get-date -DisplayHint Date)"

String is like this:

get-date -format MM/dd/yyyy
User avatar
SanSiets
Posts: 11
Last visit: Tue May 04, 2021 3:50 pm

Re: Different result

Post by SanSiets »

Thank you.
This topic is 6 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked