Skip to content

Instantly share code, notes, and snippets.

@slofurno
Last active October 12, 2015 19:26
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 slofurno/30b04b45281101e9c5a4 to your computer and use it in GitHub Desktop.
Save slofurno/30b04b45281101e9c5a4 to your computer and use it in GitHub Desktop.
get ms since utc epoch, compatible with js Date
var GetUtcMs = ((Func<Func<DateTime, long>>)(() =>
{
var _utczero = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
return x => (long)((x.ToUniversalTime() - _utczero).TotalMilliseconds);
}))();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment