ID: 41049
User updated by: dobes at lnx dot cz
Reported By: dobes at lnx dot cz
-Status: Feedback
+Status: Open
Bug Type: Date/time related
Operating System: gentoo linx
PHP Version: 5.2.1
New Comment:
In documentation you provide continent/location for setting timezone
(in documentation $timezone_identifier)
You are able set timezone by timezone code (UTC, WET, CET, etc.).
This timezone is defined like distance form UTC (ie. CET = UTC+1).
It's strange to accept UTC+2 for dates when some places in current
timezone has summer time (for CET it's CEST) because some countries
don't have summer time (Algeria has CET, but they don't have any CEST).
So add this type of intelligence into functions is simply bad. For
getting correspondent local time is continent/location and not shifting
timezones.(CET != CEST)
May be CET is not the best example. Better is WAT. Only one country use
summertime and PHP is automatically returning WAST...
Solution:
- add description of this behaving into documentation (easiest way) or
- handle timezones like UTC+n, so add summertime codes, because now
setting CEST fails.
Please let me know if miss something.
Previous Comments:
------------------------------------------------------------------------
[2007-04-13 20:13:17] [EMAIL PROTECTED]
Please explain what exactly you think is wrong.
I don't understand a word from your description.
A short reproduce case with expected and actualy values would help a
lot.
------------------------------------------------------------------------
[2007-04-13 18:41:40] dobes at lnx dot cz
Bug is in the documentation (unexpected and undocumented behavior).
------------------------------------------------------------------------
[2007-04-12 06:40:36] dobes at lnx dot cz
And it's good behaving for WAT timezone to? 10 states use only WAT and
only one is using WAT/WAST. (and PHP is only checking if for timezone is
relevant summer time and returned always summertime).
So add description of this behaving into documentation because if you
are able define timezone by place (good for handling normal/summer time)
is strange to get summer time when you are setting normal time.
May be it's because backward compatibility but it's not described in
documentation. Luckily I implemented function at good time (CEST).
Solution will be using UTC+n but it returned error too :-(
------------------------------------------------------------------------
[2007-04-11 10:44:05] [EMAIL PROTECTED]
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).
------------------------------------------------------------------------
[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