Jump to content

Timestamp Formatting


son

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...