note 57276 deleted from function.date by nlopess

From: Date: Thu, 29 Sep 2005 08:33:13 +0000
Subject: note 57276 deleted from function.date by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-95964@lists.php.net to get a copy of this message
Note Submitter: defcon5 at home dot nl Reason: useless ---- Well i want convert a unix time stamp to the lokaltime. So i made this script that should do the trick. Verry simple, but you need to think of it. <?php $lokaltime = time()."<br>"; echo $lokaltime; echo date('d-m-Y / H:i:s',$lokaltime)."<br>"; ?> So this also helpfull for users that has a unix time stamp in their dbases so you can do the following trick. <?php $insert = mysql_query( INSERT INTO [dbase_table] (date) VALUES ( ".time()." ) ); ?> and out <?php $result = mysql_query( SELECT * FROM [dbase_table]); while($row = mysql_fetch_object($result)) { echo date('d-m-Y / H:i:s',$row->date); } ?>

« previous php.notes (#95964) next »