nick_whitmarsh Posted May 16, 2007 Share Posted May 16, 2007 Hi all, I am trying to convert a date in the format of 12-Jan-2006 etc. to 2006-01-01. If anyone could help me with this i would appreciate it. Nick Link to comment https://forums.phpfreaks.com/topic/51739-converting-dates/ Share on other sites More sharing options...
kenrbnsn Posted May 16, 2007 Share Posted May 16, 2007 Use a combination of the strtotime() and date() functions: <?php $in = '12-Jan-2006'; $out = date('Y-m-d',strtotime($in)); echo $out; ?> Ken Link to comment https://forums.phpfreaks.com/topic/51739-converting-dates/#findComment-254848 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.