note 53007 deleted from function.date by nlopess

From: Date: Sun, 31 Jul 2005 16:00:19 +0000
Subject: note 53007 deleted from function.date by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-92833@lists.php.net to get a copy of this message
Note Submitter: MG_Peter at o2 dot pl ---- chris at zarkov dot co dot uk -> I know ;) I've found it, while i tried to change the timezone in mysql timestamp!!! And didn't know how to manage date. Now, i know much more about php (but it's another story ;]). easy timezone: insert user timezone to the database you can use forms' <select> or something with values as signed short integers ('-1', or '5' i.e.) example of my script... <?php include "database_connection.php"; $timezone = $_REQUEST['timezone']; $sql = mysql_query("UPDATE users SET timezone='$timezone' WHERE user='$_SESSION['username']'"); //here comes the error checking... simple if (!$sql){echo "database error"; exit;} ?> use user timezone from database. <?php $timezone = $_sql_result['timezone']; //i.e. it can be '5' or '-5' $user_date = date("d M Y H:i:s", (strtotime($your_row['lastlogin_date'])+$timezone*3600))'; ?>

« previous php.notes (#92833) next »