Re: Unix time

From: Date: Thu, 23 May 2002 10:27:48 +0000
Subject: Re: Unix time
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-98891@lists.php.net to get a copy of this message
yes I think is ok, I don't know why, but I used strtotime... (what do this function?) Thank you Cosmin Justin French <justin@indent.com.au> wrote in message news:B912FE35.732D%justin@indent.com.au... > It'd help if you showed us some code. > > If you've got a unix time stamp in your MySQL db, then all you need to do is > compare it to your local server time using time(). > > Easy. > > <? > $then = "1021877476"; // your unix timestamp stored in MySQL > $now = time(); // current time stamp > $difference = $now - $then; // in seconds > ?> > > If your date is stored in YYY-MM-DD format, you'll have to convert it to a > unix time stamp first (can be done in query, or using strtotime()). > > > Justin > > > > on 23/05/02 8:06 PM, Cosmin (cosmin@grafx.ro) wrote: > > > Hello > > > > How can I compare Unix Time? > > As integer values? > > I take the unix time from database and I compare with the current time > > and something is not functioning. Can somebody show me how can I do this? > > > > Thank you , > > Cosmin > > > > > > > > >

« previous php.general (#98891) next »