php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44129 Halt-hour timezones returning UTC
Submitted: 2008-02-15 13:12 UTC Modified: 2008-02-15 15:11 UTC
From: protomank at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.5 OS: Windows XP
Private report: No CVE-ID: None
 [2008-02-15 13:12 UTC] protomank at gmail dot com
Description:
------------
If I set the windows timzeone to a zone with half-hour, like 5:30 (clacuttah) date('T') returns UTC.
This way I can't convert timestamps to the correct time of the machine.

Reproduce code:
---------------
date('T')

Expected result:
----------------
Asia/Calcuttah

Actual result:
--------------
UTC

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-15 13:29 UTC] jani@php.net
# php -n -d date.timezone=Asia/Calcutta -r 'echo date("T");'
IST

So you're just using wrong timezone name..?
 [2008-02-15 14:57 UTC] protomank at gmail dot com
Hum, forgot to mention I was running it under Apache 2.2, sorry :(
But it doesn't affect the bug anyway.

The bug doesn't happen when you pass the timezone to PHP, but when you change the timezone in Windows and then execute simply:
php echo date("T");

This returns UTC instead of IST.
Seems like PHP is not able to correctly reading the Timezone from Windows environment, so it does not know what is the system timezone.
 [2008-02-15 15:11 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Right, that's not a bug then. Please use date.timezone ini setting to set your timezone - that's what it's for.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 19:01:36 2025 UTC