Converting DOMTimeStamp to localized HH:MM:SS MM-DD-YY via Javascript
The W3C Geolocation API (among others) uses DOMTimeStamp for its time-of-fix. This is "milliseconds since the start of the Unix Epoch". What's the easiest way to convert this into a human readable format and adjust for the local timezone? One version of the Date constructor takes the number of "milliseconds since the start of the Unix Epoch" as its first and only parameter. Assuming your timestamp is in a variable called domTimeStamp , the following code will convert this timestamp to local time (assuming the user has the correct date and timezone set on her/his machine) and print a human