- This topic has 4 replies, 4 voices, and was last updated 5 months, 2 weeks ago by
April 8, 2020 at 2:42 pm #216609ParticipantTopics: 41Replies: 94Points: 560Rank: Major Contributor
I have a small question about date format
I use Get-Date -Format “yyyy-MM-dd” which gives me 2020-04-08 however I would like to see 2020-apr-08
how do I achieve this?
the same for this one
thanks for the pointers
never mind sorted out in the mean time
- This topic was modified 5 months, 2 weeks ago by acer460527.
April 8, 2020 at 2:55 pm #216618ParticipantTopics: 4Replies: 82Points: 253Rank: Contributor
The format argument in your examples is called a format string specifier. Here is a link to the documentation for custom date/times: https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings
April 8, 2020 at 3:16 pm #216627ParticipantTopics: 1Replies: 2Points: 3Rank: Member
this may do what you need. I did a “help get-date -full” and found the info.
Get-Date -UFormat “%Y-%b-%d”
April 8, 2020 at 3:36 pm #216651ParticipantTopics: 7Replies: 2458Points: 6,439Rank: Community MVP
Why so complicated? 😉PowerShell1Get-Date -Format 'yyyy-MMM-dd'
and BTW: if you want to have the full name of the month … guess what …PowerShell1Get-Date -Format 'yyyy-MMMM-dd'
April 9, 2020 at 5:56 am #216837ParticipantTopics: 41Replies: 94Points: 560Rank: Major Contributor
thanks everyone for your input
@olaf I figured that part out as well as mentioned on my original question I found the solution shortly after I posted my question
- The topic ‘question about date format’ is closed to new replies.