Jump to content

Timestamp Formatting


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...