Date and Time

Get date and time

Let’s begin by understanding how to retrieve date and time information.

System.DateTime

Getting date and time in PowerShell is done using the cmdlet Get-Date or using the [datetime] type accelerator.

Get hands-on with 1400+ tech skills courses.