As a scripting language, Javascript is extremely powerful, yet it is pitifully weak with dates and times.
Several types of date/time operations are very difficult to accomplish (and accurately) in Javascript.
VBScript is comparatively very strong in that area, though, possessing several date/time functions,
like isDate(), dateAdd(),
dateDiff(), datePart(),
weekdayName() and monthName().
I've recreated and packaged those functions for Javascript in an include file, called jsDate.
Check it out...
isDate(), dateAdd(),
dateDiff() are the biggest helps for Javascript.  The others are just icing.
Compatibility: the functions should work in any modern browser. The demo itself works in IE and Firefox at least.
Usage: copy the file to your project, link to it, and you can begin using the functions just as would in VBScript.
Limitations: in VBScript, DateDiff() and DatePart() accept the option arguments
firstdayofweek and firstweekofyear.
jsDate ignores those arguments, and assumes Sunday and the week of January 1st (which is default in VBScript).
Enhancements: VBScript is not capable of dealing with Milliseconds.
Javascript can, though, so I enabled that extended interval for jsDate's dateAdd() and dateDiff() functions.
Other differences: jsDate's isDate() is less strict than VBScript's, and may let otherwise invalid dates through (this is because Javascript internally "corrects" the date, e.g. 1/32/2000 --> 2/1/2000).
history
2004-11-26 - v0.91: fixed datePart/ww bug, added weekdayName() & monthName(), first published
2004-08-30 - v0.9: brand new
support
As-is, etc. If you ask nicely, I may provide support via email.
credits/author
-Rob (@slingfive) Eberhardt, Slingshot Solutions
Use freely, but be honest about it. I just ask for credit.