What is the best way in c# to get the same result of javascript date.gettime() call?
The getTime() method returns the number of milliseconds since midnigh
Since JavaScript time is with respect to UTC, I think you will need something like this:
var st = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); var t = (DateTime.Now.ToUniversalTime() - st); // t.TotalMilliseconds
Now you can use the TotalMilliseconds property of the Timespan.
TotalMilliseconds
Timespan