Hi all, i was wondering if it is true that the Date object gets its date from the user's local time, if so, could the user "hack" the time by adjusting his local time?
| SitePoint Sponsor |
Hi all, i was wondering if it is true that the Date object gets its date from the user's local time, if so, could the user "hack" the time by adjusting his local time?

The time does indeed come from the users local system in the case of Javascript. So yes, if the user tampers with their local time, the time shown in javascript will be tampered as well.
Rémon - Hosting Advisor
Minimal Bookmarks Tree
My Google Chrome extension: browsing bookmarks made easy


Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript
Yup. Right from their computer's clocks. This is why it's important to validate with server-side script as well. Just in case a tricky rascal wants to try and trick the system somehow.
so if i wish to display the date that is not dependent on the user's system's clock, what may be the most appropriate solution?

Rémon - Hosting Advisor
Minimal Bookmarks Tree
My Google Chrome extension: browsing bookmarks made easy
ok thanks for the help =)
Bookmarks