php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38174 Date function error
Submitted: 2006-07-21 12:09 UTC Modified: 2006-07-21 14:11 UTC
From: hyve dot mind at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5CVS-2006-07-21 (snap) OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hyve dot mind at gmail dot com
New email:
PHP Version: OS:

 

 [2006-07-21 12:09 UTC] hyve dot mind at gmail dot com
Description:
------------
the date function return error.
My timezone is GMT +7 bangkok, hanoi, jakarta.
When i view phpinfo(). the Default timezone is correct GMT+7, but in different city "Asia/Krasnoyarsk".

When i use date("Y-m-d H:i:s");
it return 1 hour a head

When i use date("O"); 
it return 8

but when i use gmdate("Y-m-d H:i:s");
it return correct time. 7hour before my time.

I already use date_default_timezone_set and also set directly in php.ini
but it only fix my timezone only and make other timezone crowd.

Reproduce code:
---------------
date("Y-m-d H:i:s");

Expected result:
----------------
return correct date time

and add more timezone in phpinfo "Asia/bangkok, hanoi, jakarta"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-21 13:09 UTC] derick@php.net
Asia/Krasnoyarsk is the guessed timezone as you didn't specify a timezone in php.ini. If you want to see this different, you need to make a setting in php.ini and pick one of the supported zones from the documentation:
http://www.php.net/manual/en/timezones.asia.php
Instead of using php.ini you can also use the date_default_timezone_set() function that you use, and set it to the one from the list in the manual that matches your location the best.
 [2006-07-21 14:11 UTC] hyve dot mind at gmail dot com
I already use date_default_timezone_set and also set directly in
php.ini
but it only fix my timezone only and make other timezone crowd.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 00:01:27 2024 UTC