0

What's the equivalent to jQuery.now in C#? jQuery.now returns a value such as "1472654236737".

I've tried DateTime.now but I'm not sure what the format is.

  • `$.now()` returns the number of milliseconds since the Jan 1st 1970 epoch. See the question I marked as duplicate for how to do that in C# – Rory McCrossan Aug 31 '16 at 14:49

1 Answers1

0

If you are on .NET 4.6 then

DateTimeOffset.Now.ToUnixTimeMilliseconds();

is what you are looking for

Steve
  • 11,696
  • 7
  • 43
  • 81