Discussion:
[PHP-INSTALL] timezone
kranthi
2008-12-12 06:42:11 UTC
Permalink
var_dump(ini_get("date.timezone"));
echo date("e");

this code is giving output
string(0) ""
Asia/Calcutta

and ini_get_all() entry corresponding to date.timezone is an empty array

ny ideas y i m getting Asia/Calcutta as my time zone

Kranthi.
Tommy Peterson
2008-12-12 15:52:00 UTC
Permalink
Mine shows NY even though it is not set in the ini file and I did not set
it with the appropriate function. If you look at this page you will see
where PHP is looking for the time zone and the last one is the OS:
http://us2.php.net/manual/en/function.date-default-timezone-get.php
kranthi
2008-12-12 16:09:31 UTC
Permalink
thanks for the information.that saved me a lot of head-scratching.

var_dump(date_default_timezone_get()); is giving me string(13)
"Asia/Calcutta"

yet ter are two things which i dont understand.

1. TZ env variable is not set on my computer(debian OS). where did the
timezone come from
"if supported and allowed by the OS" debian allows the so
called querying while windows dosent. is this true???

2. How am i getting time as 03:01 AM, 13/12/08 IST when actually it is 09:31
PM, 12/12/08 IST ???

Kranthi.
Tommy Peterson
2008-12-12 16:18:41 UTC
Permalink
I would have to look at your server/OS to know why the time is off. But to
answer your question about TZ/Windows check this
out->http://publib.boulder.ibm.com/tividd/td/BSM/SC32-9084-00/en_US/HTML/bsmd156.htm

Also, I am not familiar with Debian. Sorry.
c***@noraheuer.ca
2008-12-12 16:19:13 UTC
Permalink
You may want to look at NTP http://www.crazysquirrel.com/computing/debian/ntp.jspx
Worked for me.

Cassie
Continue reading on narkive:
Loading...