-
-
Save bennotti/dedc825eee0b62603794e95e9f664016 to your computer and use it in GitHub Desktop.
CurrentTimeMillis() in C#
This file contains hidden or 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