For Example:
var rd = new Date(2013, 2, 15, 10, 0, 0, 0);
rd.toString();
Will return "Fri Mar 15 2013 10:00:00 GMT-0700 (Pacific Daylight Time)" Even though the current active time on the platform is "Pacific Standard Time"..
This makes no sense - it should either return TZ as the current active TZ
Why does the constructor do this?
I am going to say that this is because DST starts on March 10. So if I wanted to use JS to enter a meeting I plan to have at 10:00 am, I'm going to want that to be 10:00 AM PDT.
I tested a few scenarios, I set my TZ to Pacific, and ran your code, it tells me the same as you, 10:00 PDT, I switched the date to the 9th and it said 10:00 PST, I then told my clock to ignore DST and set it back to the 15th and it then told me 10:00 PST.
I would have to say that this is working exactly how I would expect it to work based on the time settings on my local machine.
P.S.: IE is much more responsive to changes to my local machines time settings, I had to close and re-open chrome to get it to recognize I changed my clock.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With