How can I convert nanoseconds to Datetimeoffset
?
I tried date time
long nanoseconds = 1449491983090000000;
DateTime epochTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local);
DateTime result1 = epochTime.AddTicks(nanoseconds / 100);
DateTime epochTimfe = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
DateTime result2 = epochTime.AddTicks(nanoseconds / 100);
Both result1
and result2
are giving me GMT time. i.e.,
12/7/2015 12:39:43 PM
I verified that from here
Can anyone help me how to convert nanoseconds to DateTimeOffset
?