Forum Moderators: open

Message Too Old, No Replies

convert dd/mmm/yyyy to dd/mm/yyyy in javascript

         

vijiwip

4:35 am on Feb 5, 2009 (gmt 0)

10+ Year Member



Dear Friends,

I need a javascript function which converts dd-mmm-yyyy [05-FEB-2009] to dd/mm/yyyy [05/02/2009].

Please help me out.

g1smd

9:39 am on Feb 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



And once you print dates like 05/02/2009 some of your readers will understand that to mean 5th Feb, while many others will read it as May 2nd.

See International Standard ISO 8601 for the unambiguous world-readable format that was agreed back in 1971, and which is already widely used.

RFC 3339 also refers.

coopster

1:51 pm on Feb 5, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, vijiwip.

I agree, that date could be confusing to certain audiences. However, to answer your question you could set up your months in an array and lookup/retrieve the digits based on the textual representation of any given month.