Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0a4

Bug #14148 Offset for CEST seems to be incorrect
Submitted: 2008-06-16 13:12 UTC
From: pfeigl Assigned:
Status: Open Package: Date (version 1.5.0a1)
PHP Version: 4.3.9 OS: CentOS
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 45 + 23 = ?

 
 [2008-06-16 13:12 UTC] pfeigl (Philipp Feigl)
Description: ------------ I've the following date setup on my machine: Mon Jun 16 15:00:05 CEST 2008 CEST is the central european summer time, which is UTC+2, while in winter time we have CET, which it UTC+1. However, when creating a new Date object from a UNIX timestamp (which was of course created in CEST), the resulting time is incorrect by one hour. Setting the same sommertime setup for CEST as it exists for CET in the $GLOBALS['_DATE_TIMEZONE_DATA'] array seems to fixe the issue. Test script: --------------- <?php include 'Date.php'; $ts = time(); $date = new Date($ts); echo $date->format('%d.%m.%Y %H:%M:%S'); echo "\n"; echo date('d.m.Y H:i:s', $ts); ?> Expected result: ---------------- 16.06.2008 15:03:58 16.06.2008 15:03:58 Actual result: -------------- 16.06.2008 14:03:58 16.06.2008 15:03:58

Comments

 [2008-07-21 13:04 UTC] doconnor (Daniel O'Connor)
Test script, php 5.2.6: The Date object doesn't care about the current timezone, it just assumes UTC. Output: 00.00.0000 00:00:00 21.07.2008 13:02:20 <?php date_default_timezone_set('Germany/Berlin'); require_once 'Date.php'; $ts = time(); $date = new Date($ts); echo $date->format('%d.%m.%Y %H:%M:%S'); echo "\n"; echo date('d.m.Y H:i:s', $ts);
 [2008-07-21 13:04 UTC] doconnor (Daniel O'Connor)
(which makes this slightly tricky to test and fix!)