RosettaCodeData/Task/Date-format/PowerShell/date-format.psh

6 lines
151 B
Plaintext

"{0:yyyy-MM-dd}" -f (Get-Date)
"{0:dddd, MMMM d, yyyy}" -f (Get-Date)
# or
(Get-Date).ToString("yyyy-MM-dd")
(Get-Date).ToString("dddd, MMMM d, yyyy")