PHP mySQL newbie date calculation advice!
Posted: Wed Dec 16, 2009 11:03 am
Could do with some help with the following problem.
I have extracted a date from a datetime field in a mysql database (yyy-mmm-ddd hh:mm:ss) held in f_date
and the result displays
echo $info['f_date'];
2009-11-14 12:00:00
however I would also like to display this date plus a variable amount of hours
eg
echo $info['f_date'] +5 hours;
2009-11-14 17:00:00
I have no idea how to go about this as it seems there is incompatability between PHP and mySQL formats
What I would like is a fix so I can complete the problem and a pointer to where to look so I can understand whats going off.
Thanks in advance
I have extracted a date from a datetime field in a mysql database (yyy-mmm-ddd hh:mm:ss) held in f_date
and the result displays
echo $info['f_date'];
2009-11-14 12:00:00
however I would also like to display this date plus a variable amount of hours
eg
echo $info['f_date'] +5 hours;
2009-11-14 17:00:00
I have no idea how to go about this as it seems there is incompatability between PHP and mySQL formats
What I would like is a fix so I can complete the problem and a pointer to where to look so I can understand whats going off.
Thanks in advance