Quantcast
Channel: Working with epoch time in PowerShell using UniversalTime - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Bryce McDonald for Working with epoch time in PowerShell using UniversalTime

$
0
0

If you look at Get-Help Get-Date the first parameter is a -Date option. We can use that to our advantage by wrapping our Get-Date in another Get-Date like so:

$epochseconds = Get-Date (Get-Date).ToUniversalTime() -UFormat %sreturn $epochseconds

Viewing all articles
Browse latest Browse all 2

Trending Articles