php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52429 date_default_timezone error
Submitted: 2010-07-24 18:01 UTC Modified: 2010-07-25 12:38 UTC
From: patrice dot flahault at accessprinting dot fr Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.3 OS: centos 5.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: patrice dot flahault at accessprinting dot fr
New email:
PHP Version: OS:

 

 [2010-07-24 18:01 UTC] patrice dot flahault at accessprinting dot fr
Description:
------------
The time zone Europe/Paris gives a wrong time.

date_default_timezone_set('Europe/Paris');
should be the same as :
date_default_timezone_set('Europe/Madrid');	

but there is a 6 hour difference.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-24 18:09 UTC] rasmus@php.net
-Status: Open +Status: Feedback
 [2010-07-24 18:09 UTC] rasmus@php.net
Are you sure you haven't done something else wrong?  I just fired up a Centos VM 
and tried it:

<?php
date_default_timezone_set('Europe/Paris');
echo date("H:i:s");
echo "\n";
date_default_timezone_set('Europe/Madrid');
echo date("H:i:s");

The output is:

18:08:25
18:08:25

No 6-hour difference there.
 [2010-07-24 20:30 UTC] dtajchreber@php.net
-Status: Feedback +Status: Bogus
 [2010-07-24 20:30 UTC] dtajchreber@php.net
Looks fine to me..

[david@lyon ~]$ php t.php 
int(1279996161)
string(25) "2010-07-24T20:29:21+02:00"
[david@lyon ~]$ cat t.php 
<?php
var_dump(time());
date_default_timezone_set('Europe/Paris');
var_dump(date('c'));
 [2010-07-24 20:31 UTC] dtajchreber@php.net
-Status: Bogus +Status: Feedback
 [2010-07-25 11:45 UTC] patrice dot flahault at accessprinting dot fr
-Status: Feedback +Status: Open
 [2010-07-25 11:45 UTC] patrice dot flahault at accessprinting dot fr
Ramus,

My code is : 
date_default_timezone_set('Europe/Paris');
echo date('H:i e') .'<br />';
date_default_timezone_set('Europe/Madrid');
echo date('H:i e') ;

You can try it at : www.accessprinting.fr/test/test.php
 [2010-07-25 11:51 UTC] patrice dot flahault at accessprinting dot fr
There is one difference my php version is 5.3.2
 [2010-07-25 12:38 UTC] derick@php.net
-Status: Open +Status: Bogus
 [2010-07-25 12:38 UTC] derick@php.net
Centos patches PHP's date/time stuff in odd ways. This works fine.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 05:01:30 2024 UTC