Jul 31, 2012 #1 pushyr Programmer Jul 2, 2007 159 GB is there a simple way to convert a friendly date and time to a mysql format my date and time looks like this... Tue, 31 Jul 2012 13:17:23 GMT and i'd like to both split and convert into this... 1. 2012-07-31 2. 13:17:23
is there a simple way to convert a friendly date and time to a mysql format my date and time looks like this... Tue, 31 Jul 2012 13:17:23 GMT and i'd like to both split and convert into this... 1. 2012-07-31 2. 13:17:23
Jul 31, 2012 1 #2 jpadie Technical User Nov 24, 2003 10,094 FR Code: date_default_timezone_set('Europe/Paris'); $time = strtotime('Tue, 31 Jul 2012 13:17:23 GMT'); echo date('Y-m-d', $time); echo "\r\n\"; echo date('H:i:s', $time); please note that GMT is not the same as BST. It is safest to rely on UTC for time stamps. then do the conversions to local time when you use the datum Upvote 0 Downvote
Code: date_default_timezone_set('Europe/Paris'); $time = strtotime('Tue, 31 Jul 2012 13:17:23 GMT'); echo date('Y-m-d', $time); echo "\r\n\"; echo date('H:i:s', $time); please note that GMT is not the same as BST. It is safest to rely on UTC for time stamps. then do the conversions to local time when you use the datum
Aug 1, 2012 Thread starter #3 pushyr Programmer Jul 2, 2007 159 GB cheers jpadie... i knew it were something simple like that! Upvote 0 Downvote