#41049 [NEW]: date_default_timezone_set() ignore input values
| From: | dobes at lnx dot cz | Date: | Wed, 11 Apr 2007 10:13:54 +0000 |
| Subject: | #41049 [NEW]: date_default_timezone_set() ignore input values | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-111330@lists.php.net to get a copy of this message | ||
From: dobes at lnx dot cz
Operating system: gentoo linx
PHP version: 5.2.1
PHP Bug Type: Date/time related
Bug description: date_default_timezone_set() ignore input values
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 bug report at http://bugs.php.net/?id=41049&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41049&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41049&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41049&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41049&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41049&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41049&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41049&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41049&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41049&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41049&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41049&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41049&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41049&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41049&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41049&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41049&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41049&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41049&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41049&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41049&r=mysqlcfg