Ian Obermiller

Part time hacker, full time dad.

Local time in UTC ticks with javascript

Posted

Simple method to get the current local time in UTC ticks (milliseconds since the epoch, 1970/01/01):

var currentTime = Date.now() - new Date().getTimezoneOffset() * 60 * 1000;