son Posted February 11, 2010 Share Posted February 11, 2010 I retrieve a timestamp from database, then add 30 days to it and check if the current timestamp is less than the 30+ from database. Playing around with is I have a code as: $token_limit = strtotime("+30 days",$regDate); echo $regDate; echo "<br />"; echo $token_limit; echo "<br />"; $currentTime = time(); echo $currentTime; if ($token_limit < $currentTime) { echo "<br />ok"; } It displays on page as: 2010-02-11 09:25:0025940101265883819ok Although 'ok' shows, the formatting is completely different. Does MySQL and PHP store the timestamp differently? How can I make sure it is the same format?Son Link to comment Share on other sites More sharing options...
son Posted February 11, 2010 Author Share Posted February 11, 2010 Please ignore my post, just found the solution: $mysqldate = date( 'Y-m-d H:i:s', $phpdate );$phpdate = strtotime( $mysqldate ); Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.