#41049 [Opn->Bgs]: date_default_timezone_set() ignore input values

From: Date: Wed, 11 Apr 2007 10:44:05 +0000
Subject: #41049 [Opn->Bgs]: date_default_timezone_set() ignore input values
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-111332@lists.php.net to get a copy of this message
 ID:               41049
 Updated by:       derick@php.net
 Reported By:      dobes at lnx dot cz
-Status:           Open
+Status:           Bogus
 Bug Type:         Date/time related
 Operating System: gentoo linx
 PHP Version:      5.2.1
 New Comment:

THis is how it is supposed to work. CET is really CET. CEST is a
different zone. You should *always* use the Africa/Algiers type zones
(continent/location).


Previous Comments:
------------------------------------------------------------------------

[2007-04-11 10:13:53] dobes at lnx dot cz

Description:
------------
I'm getting data with time in CET timezone.

Displaying is in local time (by configuration)

So I have to convert time from CET to Euprope/Prague (ie CET or CEST)

When I set CET in date_default_timezone_set(), I return CET or CEST
(CET + DST). When I set CEST, I get error.

Luckily one state is using CET without CEST (Algeria) so I use
date_default_timezone_set('Africa/Algiers') instead.

But I get the same behaving with WAT
(http://en.wikipedia.org/wiki/West_Africa_Time) and WAST is using only
one sate and I get WAT/WAST too.

For getting local time is ok to use Continent/City but CET is not CEST.

Reproduce code:
---------------
//date_default_timezone_set('CET');
// itme as YYMMDDHHIISS                                                
                                             
sscanf($time, '%2d%2d%2d%2d%2d%2d', $year, $month, $day, $hour,
$minute, $second);
$timestamp = mktime($hour,$minute,$second,$month,$day,$year);          
                                                                       
date_default_timezone_set('Europe/Prague');                            
                                                                      
echo date('D d.m. H:i:s', $timestamp);

Expected result:
----------------
CET != CEST (!!!) so i  expect the same result like

//date_default_timezone_set('Africa/Algiers');
// itme as YYMMDDHHIISS                                                
                                             
sscanf($time, '%2d%2d%2d%2d%2d%2d', $year, $month, $day, $hour,
$minute, $second);
$timestamp = mktime($hour,$minute,$second,$month,$day,$year);          
                                                                       
date_default_timezone_set('Europe/Prague');                            
                                                                      
echo date('D d.m. H:i:s', $timestamp);

Actual result:
--------------
Wrong behaving. PHP expecting CET = CEST in CEST range.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41049&edit=1


Thread (10 messages)

« previous php.bugs (#111332) next »