homotechsual / NinjaOne

MIT License
85 stars 25 forks source link

Format of returned dates #4

Closed homotechsual closed 3 years ago

homotechsual commented 3 years ago

i am guessing the below is a date of some sort?

created : 1624014024,761 lastContact : 1631110371,339 lastUpdate : 1631110372

How is it structured? like ddmmyyyy or what? it does not make sense to me lol

Originally posted by @duffman36 in https://github.com/homotechsual/NinjaRMM/issues/3#issuecomment-915280628

homotechsual commented 3 years ago

These are dates in a UNIX Epoch format (number of seconds and milliseconds since January 1st 1970).

You can turn these into a PowerShell DateTime object like so:

([DateTime]::UnixEpoch).AddMilliseconds($Created)