Get a UTC timestamp

bgcode picture bgcode · Nov 8, 2011 · Viewed 476.2k times · Source

How can I get the current UTC timestamp in JavaScript? I want to do this so I can send timestamps from the client-side that are independent of their timezone.

Answer

ExpExc picture ExpExc · Nov 8, 2011
new Date().getTime();

For more information, see @James McMahon's answer.