s_ainley87 Posted January 12, 2009 Share Posted January 12, 2009 Hello, I have a mysql field of the datetime date type and I needing to break it apart when it is pulled out the database so that I can put each bit in its own section the page, how would I do this? I assumed it would be something like date('M', $data['updated_at']); *repeat for each section* however when I run this I get JAN 01 1970, I am asumming date can only be used with timestamps? if so I am stuck, could I convert the date to a time stamp and then do it or is there a quicker way? however this returns Quote Link to comment https://forums.phpfreaks.com/topic/140499-solved-datetime-in-php-help/ Share on other sites More sharing options...
Mchl Posted January 12, 2009 Share Posted January 12, 2009 date('M', strtotime($data['updated_at'])); Also take a look at getdate Quote Link to comment https://forums.phpfreaks.com/topic/140499-solved-datetime-in-php-help/#findComment-735207 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.