note 89011 deleted from datetime.format by thiago

From: Date: Wed, 18 Feb 2009 11:59:35 +0000
Subject: note 89011 deleted from datetime.format by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-150785@lists.php.net to get a copy of this message
Note Submitter: ankit at gmail dot com ---- Following is a code to convert date & time to local date & time: include("Date.php"); $d = new Date(date('Y-m-d H:i:s')); $d->setTZByID("GMT"); $d->convertTZByID("IST"); $date = $d->format("%Y-%m-%d %T"); I made a small mistake in second statement which was: $d = new Date(date('Y-m-d H:i:s A')); which resulted in last statement to rerurn time diference instead of current time. I wasted hours to find out this, which I don't want anybody to waste...:)

« previous php.notes (#150785) next »