Skip to content

Instantly share code, notes, and snippets.

@bennotti
Forked from AntonyKapustin/TimeUtils.cs
Created March 15, 2022 22:47
Show Gist options
  • Save bennotti/dedc825eee0b62603794e95e9f664016 to your computer and use it in GitHub Desktop.
Save bennotti/dedc825eee0b62603794e95e9f664016 to your computer and use it in GitHub Desktop.

Revisions

  1. @AntonyKapustin AntonyKapustin created this gist Aug 30, 2015.
    11 changes: 11 additions & 0 deletions TimeUtils.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    using System;

    public class TimeUtils {
    private static readonly DateTime Jan1st1970 = new DateTime
    (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);

    public static long CurrentTimeMillis()
    {
    return (long) (DateTime.UtcNow - Jan1st1970).TotalMilliseconds;
    }
    }