jasonc Posted September 24, 2010 Share Posted September 24, 2010 I wish to know how i can convert this date 24-09-2010 to this format 2010-09-24 Link to comment https://forums.phpfreaks.com/topic/214294-i-wish-to-know-how-i-can-convert-this-date-24-09-2010-to-this-format-2010-09-24/ Share on other sites More sharing options...
kenrbnsn Posted September 24, 2010 Share Posted September 24, 2010 I would use the explode and list functions: <?php $old_date = '24-09-2010'; list($d,$m,$y) = explode('-',$old_date); $new_date = "$y-$m-$d"; echo $new_date; ?> Ken Link to comment https://forums.phpfreaks.com/topic/214294-i-wish-to-know-how-i-can-convert-this-date-24-09-2010-to-this-format-2010-09-24/#findComment-1115121 Share on other sites More sharing options...
jasonc Posted September 24, 2010 Author Share Posted September 24, 2010 great thank you Link to comment https://forums.phpfreaks.com/topic/214294-i-wish-to-know-how-i-can-convert-this-date-24-09-2010-to-this-format-2010-09-24/#findComment-1115138 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.