1. Home
  2. Computing & Technology
  3. JavaScript
photo of Stephen Chapman
Stephen's JavaScript Blog

By Stephen Chapman, About.com Guide to JavaScript since 2004

Month and Day Names

Thursday January 1, 2009
JavaScript doesn't supply all the date methods we are likely to need but we can easily add the missing ones ourselves

When you are displaying a date, the day of the week and month of the year are far better displayed as names rather than numbers (which day of the week is 3?, is 4/2/07 the 4th February or the 2nd April or even the 7th February 2004?). JavaScript doesn't actually supply methods for directly retrieving these names, presumably because they need to be different depending on which language you want them in. We can easily add our own methods to do this though for our selected language (I'll choose English).

Month and Day Names
Comments

No comments yet. Leave a Comment

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.