PHP/MySQL Date Question
Posted: Mon Jul 21, 2008 5:34 pm
Not sure which forum this belongs in since the issue relates both to PHP and MySQL.
I have a table in MySQL which uses the MySQL 'datetime' to hold dates. What I need to do is basically compare those dates to a Unix timestamp and determine if they are after the Unix timestamp I'm comparing too.
The problem is I'm not sure how to do this. Is there MySQL functions to convert Unix timestamps to datetimes from which I can then compare the two? Or do I need to somehow convert the Unix timestamp to that of a 'datetime' and then try to compare it like that?
Cheers,
Josh
I have a table in MySQL which uses the MySQL 'datetime' to hold dates. What I need to do is basically compare those dates to a Unix timestamp and determine if they are after the Unix timestamp I'm comparing too.
The problem is I'm not sure how to do this. Is there MySQL functions to convert Unix timestamps to datetimes from which I can then compare the two? Or do I need to somehow convert the Unix timestamp to that of a 'datetime' and then try to compare it like that?
Cheers,
Josh