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
  • 184,186
  • 23
  • 230
  • 299
Uliysess
  • 429
  • 1
  • 4
  • 18

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
  • 64,730
  • 6
  • 79
  • 125