note 113195 added to timezones.asia

From: Date: Wed, 11 Sep 2013 10:19:00 +0000
Subject: note 113195 added to timezones.asia
Groups: php.notes 
Request: Send a blank email to php-notes+get-196228@lists.php.net to get a copy of this message
I've tested "Asia/Calcutta" as well as "Asia/Kolkata" on PHP 5.4.7 and both returns accurate results. But I would suggest you to use "Asia/Kolkata" as "Calcutta" is now renamed to "Kolkata". <?php date_default_timezone_set("Asia/Kolkata"); echo date('d-m-Y H:i:s'); //Returns IST ?> On the other hand, you can also set the timezone to UTC, and later add 19800 seconds(Time offset) to get Indian Standard Time. <?php date_default_timezone_set('UTC'); $ist = strtotime('now') + 19800; echo date('d-m-Y H:i:s', $ist); ?> ---- Server IP: 69.147.83.199 Probable Submitter: 59.182.70.196 ---- Manual Page -- http://php.net/manual/en/timezones.asia.php Edit -- https://master.php.net/note/edit/113195 Del: integrated -- https://master.php.net/note/delete/113195/integrated Del: useless -- https://master.php.net/note/delete/113195/useless Del: bad code -- https://master.php.net/note/delete/113195/bad+code Del: spam -- https://master.php.net/note/delete/113195/spam Del: non-english -- https://master.php.net/note/delete/113195/non-english Del: in docs -- https://master.php.net/note/delete/113195/in+docs Del: other reasons-- https://master.php.net/note/delete/113195 Reject -- https://master.php.net/note/reject/113195 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#196228) next »