scott.stephan Posted June 9, 2009 Share Posted June 9, 2009 In the current app I'm working on, there are a lot of functions that use dates and time to trigger certain actions. I like PHP DATE stuff because you can perform easy arithmetic on it. I like SQL DATETIME because you can store all of your time data in one chunk instead of having order_hour, order_minute, order_day, order_month etc. etc,. What I'm a little unsure of is how PHP and SQL are going to play along when it comes to dates. Honestly, it seems like it may be a pain to pull a date from SQL and parse it into usable pieces. Does anyone have a guide or an article on the challenges of swapping between SQL and PHP with regards to DATE/TIME stuff? Quote Link to comment Share on other sites More sharing options...
xtopolis Posted June 9, 2009 Share Posted June 9, 2009 Are you saying you manage PHP dates in a format different than: YYYY-MM-DD HH:MM:SS ? What are you trying to do? Afaik, sticking with the DATETIME format of MySQL is simple for PHP as well. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 9, 2009 Share Posted June 9, 2009 Mysql has a large number of built-in date and time functions, which are more useful and capable than what php currently has, that make using php code unnecessary for most tasks (and php code to accomplish the same task is also several times slower.) Ref: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html Quote Link to comment 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.