e.g., if you had:
var d = new Date();
alert(d.getTime());
is it based on the system clock? if i change the time/date on my computer's clock, am i potentially sending erroneous data back to my server?
e.g., if you had:
var d = new Date();
alert(d.getTime());
is it based on the system clock? if i change the time/date on my computer's clock, am i potentially sending erroneous data back to my server?
Share Improve this question asked May 6, 2011 at 9:14 johnjohn 35.4k12 gold badges48 silver badges62 bronze badges 1- 1 I am curious what you think it would have been based off of if not the system clock. :) – epascarello Commented May 6, 2011 at 9:21
2 Answers
Reset to default 15This uses the system time on the client computer where this javascript is executed. So if you change the date/time on the client computer it will send the new value to the server.
Yes, it uses the system time on the client side.
When posting data, you don't need to post the date of the request (which I think it what you are trying to do), just get the current date (server side) when the post request is made and use this as your date.