php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25891 strtotime() returns wrong timestamp
Submitted: 2003-10-16 16:00 UTC Modified: 2003-10-16 20:58 UTC
From: will at powerplantmedia dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.3 OS: Red Hat
Private report: No CVE-ID: None
 [2003-10-16 16:00 UTC] will at powerplantmedia dot com
Description:
------------
strtotime() returns the wrong timestamp.  i cannot find a pattern to the errors.


'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-ftp' '--enable-magic-quotes' '--with-mysql=/usr' '--with-pear' '--with-pgsql=/usr' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-zlib' 

Reproduce code:
---------------
echo date("l",strtotime("1 Tuesday",1066323000))." ".strtotime("1 Tuesday",1066323000)."<br>"; 
echo date("l",strtotime("2 Tuesday",1066323000))." ".strtotime("2 Tuesday",1066323000)."<br>"; 
echo date("l",strtotime("+1 week",strtotime("Tuesday",1066323000)))." ".strtotime("Tuesday",1066323000);

Expected result:
----------------
Tuesday 1066712400
Tuesday 1067361000
Tuesday 1066712400

Actual result:
--------------
Tuesday 1066712400
Monday 1067317200
Tuesday 1066712400

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-16 20:58 UTC] iliaa@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.

This a duplicate report of similar (already open & verified) bug reports pertaining to strtotime() function.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 23:01:32 2024 UTC