Created
October 24, 2016 15:45
-
-
Save aaronhoffman/b6dd5fa2e8efcac3c5cc973a544799cb to your computer and use it in GitHub Desktop.
Convert Epoch Seconds to C# DateTime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static readonly DateTime _epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); | |
public DateTime EpochSecondsToDateTime(int secondsSinceEpoch) | |
{ | |
return _epoch.AddSeconds(secondsSinceEpoch); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment