JavaScript Dates
Tuesday, July 22nd, 2008Yesterday we looked at all the methods that JavaScript provides for working with arrays. Today we take a similar look at dates and the ways that JavaScript can work with dates and times.
Yesterday we looked at all the methods that JavaScript provides for working with arrays. Today we take a similar look at dates and the ways that JavaScript can work with dates and times.
This particular golden oldie is particularly relevant today as today marks the end of daylight savings time in Western Australia for this year. I had to pay particular attention to the end of DST this year because the Eastern states where I live have decided to extend DST by an extra week and so I had to spend time locating all of the affected scripts on my site to update them. DST will now end next Sunday instead.
This really early JavaScript that I wrote is one that needs to be able to know when it is and isn’t DST at your location because this JavaScript converts the time from your visitor’s computer (assuming that they have their time and timezone set correctly) to display the time where you the author of the page is located.