|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64294 date conversion problem when dst present
Submitted: 2013-02-25 09:55 UTC Modified: 2013-11-27 17:26 UTC
From: ybrigant at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.22 OS: linux debian
Private report: No CVE-ID: None
 [2013-02-25 09:55 UTC] ybrigant at gmail dot com
COnversion of an utc timestamp to a date in a scpecific timezone, ie EUrope/Paris where we have dst activated in the date example...

Test script:
$timestamp = 1382954400;
$date = new \DateTime('@'.$timestamp);
$tz = new \DateTimeZone('Europe/Paris');
return $date->format(Y-m-d H:i');

Expected result:
2013-10-28 12:00

Actual result:
2013-10-28 11:00


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-25 10:42 UTC] ybrigant at gmail dot com
Sorry, I forgot to add that timestamp provided is in utc timezone.
 [2013-02-27 01:26 UTC] mail+php at requinix dot net
DST in Europe ends at 2013-10-27 01:00.

By the way, Unix timestamps don't have timezones.
 [2013-02-27 01:28 UTC] mail+php at requinix dot net
01:00 UTC that is, so 02:00 Europe/Paris.
 [2013-11-27 17:26 UTC]
-Status: Open +Status: Not a bug
 [2013-11-27 17:26 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

This does look just fine:

$timestamp = 1382954400;
$date = new \DateTime('@'.$timestamp);
echo $date->format('Y-m-d H:i T O'), "\n";
$tz = new \DateTimeZone('Europe/Paris');
echo $date->format('Y-m-d H:i T O'), "\n";

outputs as expected:

2013-10-28 10:00 GMT+0000 +0000
2013-10-28 11:00 CET +0100
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Dec 08 05:05:52 2022 UTC