swingking Posted December 4, 2006 Share Posted December 4, 2006 is there a simple way to convert...12/4/2006 7:32:48 PMinto2006-12-04 19:32:48 ??thanks! Quote Link to comment https://forums.phpfreaks.com/topic/29405-datetime-conversion/ Share on other sites More sharing options...
Darkness Soul Posted December 4, 2006 Share Posted December 4, 2006 Yo,The fast/only way I think is using truncate.. date won't recognize the first format, so, you can't use date(); to convert directly.. truncate space, truncate '/' and ':', regroup the array values as you wish..:)D.Soul Quote Link to comment https://forums.phpfreaks.com/topic/29405-datetime-conversion/#findComment-134920 Share on other sites More sharing options...
Zane Posted December 4, 2006 Share Posted December 4, 2006 [code=php:0]date("Y-m-d H:i:s", strtotime("12/4/2006 7:32:48 PM"));[/code] Quote Link to comment https://forums.phpfreaks.com/topic/29405-datetime-conversion/#findComment-134923 Share on other sites More sharing options...
Darkness Soul Posted December 6, 2006 Share Posted December 6, 2006 Wow, :DThis may also useful to me!D.Soul Quote Link to comment https://forums.phpfreaks.com/topic/29405-datetime-conversion/#findComment-136082 Share on other sites More sharing options...
swingking Posted December 7, 2006 Author Share Posted December 7, 2006 sweet! thanks! Quote Link to comment https://forums.phpfreaks.com/topic/29405-datetime-conversion/#findComment-137129 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.