Converting timestamp

Your timestamp format is in fact in Seconds (Unix timestamp) as opposed to microseconds. If so the answer is as follows:

Change:

var date = new DateTime.fromMicrosecondsSinceEpoch(timestamp);

to

var date = DateTime.fromMillisecondsSinceEpoch(timestamp * 1000);

Leave a Comment