Are Javascript date/time functions dependent on the client machine?

datetime, javascript, jquery

Solution

As thomasrutter has said javascript date functions are reliant on the client's machine. However if you want to get an authoritative date you could make and ajax request to your server that just returns the date string. You can then convert the date string into a date object with the following

var ds = ... // Some ajax call
var d = new Date(ds);

Problem

I was wondering if Javascript date/time functions will always return correct, universal dates/times or whether, Javascript being a client-side language, they are dependent on what the client machine has its date set to. If it is dependent on the client machine, what is the best way to get the correct universal time?

Original source