I need to get number of milliseconds from the epoch in GMT.
Can I use this for the GMT part:
DateTime.Now.ToUniversalTime()
What about the number of milliseconds since the epoch?
I need to get number of milliseconds from the epoch in GMT.
Can I use this for the GMT part:
DateTime.Now.ToUniversalTime()
What about the number of milliseconds since the epoch?
This should give you a TimeZone agnostic answer.
TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1);
double ms = t.TotalMilliseconds ;