Skip to content

Instantly share code, notes, and snippets.

@aaronhoffman
Created October 24, 2016 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronhoffman/b6dd5fa2e8efcac3c5cc973a544799cb to your computer and use it in GitHub Desktop.
Save aaronhoffman/b6dd5fa2e8efcac3c5cc973a544799cb to your computer and use it in GitHub Desktop.
Convert Epoch Seconds to C# DateTime
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