RosettaCodeData/Task/Date-format/PowerShell/date-format.ps1
2026-04-30 12:34:36 -04:00

5 lines
151 B
PowerShell

"{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")