Page 1 of 1

date question

Posted: Tue Jan 09, 2007 9:34 pm
by speedy33417
I'm working with dates in a db that store in a YYYY-MM-DD HH:MM:SS format. What is the easiest way to do the following?

1) Determining what day of the week that is (Mon, Tue...)
2) Adding one day to it (where it calculates a new month, year, leap year...)
3) Adding one hour to it
4) Calculating the difference between dates

Thanks

Posted: Tue Jan 09, 2007 9:37 pm
by aaronhall
You could explore MySQL's temporal functions, or use strtotime() from PHP