Can anyone explain to me why?
d = Date.parse('8/15/2012 '+'11:59:45 AM');
alert(d);
alert(Date.UTC(2012, 7, 15, 11, 59, 45));
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Date.parse assumes local time if not specified.
The UTC one, however, is obviously UTC.
For example, my computer is UTC -5 (well, Chicago CDT actually), so the two timestamps happen to be 5 hours apart for me.
You will get the same thing if you specify UTC: