php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29809 strtotime is loosing seconds and minutes and hours info
Submitted: 2004-08-24 09:21 UTC Modified: 2004-08-24 09:36 UTC
From: never_slept at yahoo dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.0.1 OS: Suse 9.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: never_slept at yahoo dot com
New email:
PHP Version: OS:

 

 [2004-08-24 09:21 UTC] never_slept at yahoo dot com
Description:
------------
strtotime is loosing seconds and minutes and hours info when used with its second argument.

Reproduce code:
---------------
    echo strtotime("+10 seconds", strtotime("2004/08/24 12:17:10"));
    echo "<br>";
    echo strtotime("2004-08-24 12:17:20");
    echo "<br>";
    

    echo "<pre>";
    print_r(getdate(strtotime("+10 seconds", strtotime("2004/08/24 12:17:10"))));
    print_r(getdate(strtotime("2004-08-24 12:17:20")));
    echo "</pre>";


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-24 09:24 UTC] never_slept at yahoo dot com
strtotime is loosing seconds and minutes and hours info when used with its second argument. The example code should output the same integer values - but it doesn't. Use getdate on the resulting values and you find that hours, minutes and seconds got zero'd.
 [2004-08-24 09:29 UTC] derick@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. 

Thank you for your interest in PHP.

Duplicate of #29557
 [2004-08-24 09:36 UTC] never_slept at yahoo dot com
Yes I read that bug report and although them sounded to potentially be the same thing... my strtotime("now") does in fact spit out a different value every second and that bug report makes no mention of using the second argument for strtotime(). So please reconsider carefully if this is really a duplicate. Seeing as you took all of a couple of minutes last time.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 12:01:34 2024 UTC