Skip to content

Instantly share code, notes, and snippets.

@solidnerd
Last active August 29, 2015 14:21
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 solidnerd/e0c976c8e68c491a7b01 to your computer and use it in GitHub Desktop.
Save solidnerd/e0c976c8e68c491a7b01 to your computer and use it in GitHub Desktop.
Helps to get the actual Time for Java.Date(long ...)
class Program {
static void Main(string[] args) {
DateTime Jan1st1970 = new DateTime(1970,1,1,0,0,0);
long diff = (long) (DateTime.Now.ToLocalTime() - Jan1st1970).TotalMilliseconds;
Console.WriteLine(diff);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment