Created
August 30, 2015 14:49
-
-
Save AntonyKapustin/6516169f6a6f5959d63e to your computer and use it in GitHub Desktop.
CurrentTimeMillis() in C#
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
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice one, bro! Nice to me migre to C# from Java. Thanks :)