Forum Moderators: coopster

Message Too Old, No Replies

Simple change of date format

change format from 20/02/2006 to 2006/02/20

         

omoutop

11:55 am on Oct 3, 2005 (gmt 0)

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



Hi to all!

I need ur wisdom guys...I ahve a javascript calendar to display dates in text boxes...however..the date is in this format : 20/02/2006..is there any way I can change it to this fromat: 2006/02/20 before submitting to DB?

thx in advance

arran

12:26 pm on Oct 3, 2005 (gmt 0)

10+ Year Member



Hi omoutop,

Try something like:


list($day,$month,$year) = split("/",$old_date);
$new_date = $year."/".$month."/".$day;

arran.

omoutop

12:57 pm on Oct 3, 2005 (gmt 0)

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



thx very much arran..it works fine!