php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22998 strtotime handles DST very badly
Submitted: 2003-04-01 02:16 UTC Modified: 2003-04-01 06:10 UTC
From: przemek at cert dot pl Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.3.1 OS: Debian, Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: przemek at cert dot pl
New email:
PHP Version: OS:

 

 [2003-04-01 02:16 UTC] przemek at cert dot pl
  $date_time=strtotime("20030330 0100");
  echo "date_time reads: $date_time\n";
  $date_time=strtotime("+1 hour", date_time);
  echo "date_time reads: $date_time\n";

produces output:

  date_time reads: 1048982400
  date_time reads: 3600

I must say I wouldn't mind getting "2003-03-30 03:00", but
"1970-01-01 00:00" is more than surprising...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-01 02:45 UTC] rasmus@php.net
Try adding a $ in front of date_time on line 3
 [2003-04-01 02:57 UTC] przemek at cert dot pl
My mistake, there should be a '$', of course, but nevertheless the result is -1 this time.
 [2003-04-01 06:10 UTC] sniper@php.net
Works fine using PHP 4.3.2-RC. (on Linux..)

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 12:01:27 2025 UTC