PDA

View Full Version : change date format


sarah
03-29-2003, 01:26 PM
Hi,

Is there anyway of changing the format of a date field that has been passed on from a previous page?

Explain....

I have a PHP page which passes on the date in the YYYY/MM/DD format to a htm page. The date is displayed on screen using Javascript, is it possible to display the date in the following format DD/MM/YYYY?

Is there an inverse function in JS?

Sarah

liorean
03-29-2003, 02:00 PM
var aTemp=str.split(/\//g);
aTemp.reverse();
str=aTemp.join('/');