guiguiblitz
guiguiblitz

Reputation: 407

What is the time source for Date()?

I can't manage to find what the source is for the JavaScript Date() method.

Upvotes: 0

Views: 128

Answers (1)

James Thorpe
James Thorpe

Reputation: 32222

The specification says:

When Date is called as a function rather than as a constructor, it returns a String representing the current time (UTC).

Additionally, if you call the Date function as a constructor, it says:

...the time value (UTC) identifying the current time

So in both cases, the specification says "the current time". It is up to the implementer (ie the browser) how it determines what "the current time" is, but it's usually driven by the time upon the device it is running.

Upvotes: 5

Related Questions