RE: [PHP] timestamp and NOW('') in php / mysql

From: Date: Fri, 04 Aug 2000 18:27:06 +0000
Subject: RE: [PHP] timestamp and NOW('') in php / mysql
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-10176@lists.php.net to get a copy of this message
> $my_new_time_stamp = mktime (); > print ("<BR>output new stamp: $my_new_time_stamp"); > print ("<BR>output db value : $myrow->time_stamp"); > > the output: > > output new stamp: 965411494 > output db value : 20000804185021 Keep in mind that the values SHOULD be different. mktime is based on the number of seconds since the server's epoch date (usually something like 01/01/1970) You'll notice though MySQL's TIMESTAMP(14) is considerably different. 20000804185021 Just by adding a few punctuation marks you should see what's different 2000-08-04 18:50:21 So the values from mktime() and timestamp(14) will always be different since they use different methods of calculating date/time. Sincerely, Craig Vincent ------------------------- Senior Programmer Jazzmonkey Media Inc. http://www.jazzmonkey.com -------------------------

« previous php.general (#10176) next »