note 36541 added to function.pg-fetch-object

From: Date: Tue, 14 Oct 2003 12:43:42 +0000
Subject: note 36541 added to function.pg-fetch-object
Groups: php.notes 
Request: Send a blank email to php-notes+get-58567@lists.php.net to get a copy of this message
When you retrieve the contents of a "timestamp with timezone" field, this will set the environment's timezone variables. Therefore, this is dangerous: $s=$row->mydatefield; $unixtimestamp=postgresqltimestamp2unix($s); echo date("Y-m-d H:i:s",$unixtimestamp); Here, postgresqltimestamp2unix is a function that converts the postgresql timestamp to Unix. The retrieval of the field data in the first line of the example above will influence the timezone used in date() in the third line. ---- Manual Page -- http://www.php.net/manual/en/function.pg-fetch-object.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36541 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36541&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36541&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#58567) next »