≡ Menu

Get current UTC time using PowerShell

In this powershell tip post, let us see how to find the current UTC time. There are several ways available to do this but one easy and simple way I found is by  using [System.DateTime] class.

[System.DateTime]::UtcNow

This displays the current UTC date time information. See below screenshot for easy understanding.

UTCTime

Alternatively you can try below code as well.

$datetime = Get-Date            
$datetime.ToUniversalTime()
utctimealternative

Please subscribe to this blog for more such tips.

 

Comments on this entry are closed.

  • Bill Sproule February 12, 2020, 7:29 am

    Format UTC date time with:
    (Get-Date).ToUniversalTime().ToString(‘yyMMddTHHmmss’)