Logo

Programming-Idioms

History of Idiom 98 > diff from v19 to v20

Edit summary for version 20 by Kit Grose:
New Csharp implementation by user [Kit Grose]

Version 19

2019-01-24, 12:33:12

Version 20

2019-09-27, 03:19:07

Idiom #98 Epoch seconds to date object

Convert a timestamp ts (number of seconds in epoch-time) to a date with time d. E.g. 0 -> 1970-01-01 00:00:00

Idiom #98 Epoch seconds to date object

Convert a timestamp ts (number of seconds in epoch-time) to a date with time d. E.g. 0 -> 1970-01-01 00:00:00

Code
var d = DateTimeOffset.FromUnixTimeSeconds(ts).UtcDateTime;
Doc URL
https://docs.microsoft.com/en-us/dotnet/api/system.datetimeoffset.fromunixtimeseconds