JRS: In article <Xns93EB1278DD2B0sjorden@198.80.55.250>, seen in
news:comp.lang.javascript, Sean Jorden <s_j_o_r_d.e.n@no.spam.n_o_r_a.d.a.com>
posted at Wed, 3 Sep 2003 07:49:46 :-[color=blue]
>"Max" <cefernan@cgey.com> wrote in
>news:bj45mq$dt9$1@s1.read.news.oleane.net:
>[color=green]
>> doesn't help much
>> "Lee" <REM0VElbspamtrap@cox.net> a écrit dans le message news:
>>
Join Bytes!...[color=darkred]
>>> Max said:
>>> >
>>> >I need a little javascript function that returns the date of today
>>> >in the format dd/mm/yyyy
>>> >example:
>>> >September 2, 2003 ==> 02/09/2003[/color][/color]
>
>
><html>
> ... ... ... ...
></html>[/color]
But he specifically requested a little function.
function LZ(x) {return(x<0||x>9?"":"0")+x}
function formatDate(date) {
with (date) return LZ(getDate())+'/'+LZ(getMonth()+1)+'/'+getFullYear()
}
document.write(formatDate(new Date()))
--
© 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.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.