JRS: In article <3f************ **********@news .euronet.nl>, seen in
news:comp.lang. javascript, Janwillem Borleffs <jw@jwscripts.c om> posted
at Tue, 21 Oct 2003 18:02:22 :-
"Christophe r Benson-Manica" <at***@nospam.c yberspace.org> wrote in message
news:bn******* ***@chessie.cir r.com... What would be the best way to convert a month number to its corresponding
string? I.e, 3 -> 'March'. Is there a builtin function or must I use a
lookup table or something?
Just use an array, e.g.:
var months = ['January', 'February', ....etc]
and then:
var monthString = months[new Date().getMonth ()];
That array will give April for the index 3. The OP, starting with the
conventional number for the month, must either subtract 1 or add a dummy
zeroth month : ['', 'Janu... .
The code given is correct, but for a different question.
--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.