PowerShell - Date and Time using Get-Date

by
Jeremy Canfield |
Updated: August 02 2022
| PowerShell articles
Get-Date without any options will return the current date and time.
> Get-Date
Monday, August 1, 2022 11:50:55 PM
The -format option can be used to format the output.
> Get-Date -format 'MM/dd/yyyy HH:MM:ss'
08/01/2022 23:08:35
Or, ToString can be used to format the output.
> (Get-Date).ToString('MM/dd/yyyy HH:MM:ss')
08/01/2022 23:08:35
Did you find this article helpful?
If so, consider buying me a coffee over at