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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/51739-converting-dates/#findComment-254848 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.