Powershell - Get System Date


Advertisements

Cmdlet

Get-Date cmdlet is used to get System Date.

Example 1

In this example, we're using Get-Date without any parameter

Type the following command in PowerShell ISE Console

Get-Date

Output

You can see following output in PowerShell console.

Get-Date
Wednesday, April 04, 2018 5:24:51 PM

Example 2

In this example, we're using -DisplayHint to print only Date.

Type the following command in PowerShell ISE Console

Get-Date -DisplayHint Date

Output

You can see following output in PowerShell console.

Get-Date -DisplayHint Date
Wednesday, April 04, 2018
powershell_dates_timers.htm
Advertisements