0

I get a timestamp like below as a string:

1485661375

I need to parse it to unix timestamp and check if it is older than 8h.

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
Uliysess
  • 579
  • 1
  • 8
  • 19

1 Answers1

0
[datetimeoffset]::FromUnixTimeSeconds('1485661375') -gt (get-date).AddHours(-8)

requires .NET 4.6, for converting without .NET 4.6 you can refer to this thread.

Community
  • 1
  • 1
4c74356b41
  • 69,186
  • 6
  • 100
  • 141