Skip to content

Instantly share code, notes, and snippets.

@AntonyKapustin
Created August 30, 2015 14:49
Show Gist options
  • Save AntonyKapustin/6516169f6a6f5959d63e to your computer and use it in GitHub Desktop.
Save AntonyKapustin/6516169f6a6f5959d63e to your computer and use it in GitHub Desktop.
CurrentTimeMillis() in C#
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;
}
}
@LucasAlfare
Copy link

Nice one, bro! Nice to me migre to C# from Java. Thanks :)

@z-ali790
Copy link

Very Nice
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment