0

I'm getting info about chromeos devices through the directory API. https://developers.google.com/admin-sdk/directory/reference/rest/v1/chromeosdevices The autoupdateexpiration field returns an int64 value for this.
In C# when I try to convert to a datetime with new DateTime(autoupdatexpiration) I don't get a valid date. An example of a device returns this: 1843455600000 In the Google Admin console, the auto update expiration for this device is showing Jun 2028.
How do I convert this int to a DateTime with value Jun 2028

user568551
  • 337
  • 3
  • 11
  • `new DateTime(autoupdatexpiration)` <-- The `DateTime(Int64)` ctor is intended for serialization scenarios, _not_ interopability. – Dai Sep 23 '22 at 13:38
  • `1843455600000` looks like a Unix timestamp graduated in milliseconds: https://en.wikipedia.org/wiki/Unix_time – Dai Sep 23 '22 at 13:40
  • Thank you. It was indeed a Unix timestamp. I didn't think about that. – user568551 Sep 23 '22 at 14:49

0 Answers0