Javascript and the Date object
October 2nd, 2007 – sprocketrocketI learned a few new things about the Javascript Date object today:
- When using this constructor:
new Date(year, month, day);, month is 0 based. So, if you want to create a date object for September 30, 2007, it would look like this: new Date(2007, 8, 30); - It’s far better to use a completely different constructor - one that takes a date string, parses it, and returns a valid date object. So like this:
new Date('9/30/2007');will generate September 30, 2007.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
Posted in The Geeks, sprocketrocket, Firefox, Microsoft .Net, Visual Studio 2005 | No Comments »










