php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10145 strtime("") result?
Submitted: 2001-04-03 15:57 UTC Modified: 2001-04-29 11:49 UTC
From: colin at easydns dot com Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.0 Latest CVS (03/04/2001) OS: RH 7.0
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: colin at easydns dot com
New email:
PHP Version: OS:

 

 [2001-04-03 15:57 UTC] colin at easydns dot com
strtotime("") returns the timestamp for midnight on the current date.

I suppose if you think about it a bit, it makes sense (since the modification you are making to the current date is empty), but I would suggest that it should return either a warning or nothing.

A lot of people (judging from the manual notes) use strtotime() to parse an existing date string, not to do a "+30 days" modification to it.  For them, the strtotime("") result is not intuitive, I think.

Perhaps the confusion could be fixed by having one function to parse date/time strings and one to do the "+X days" modification?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-29 11:49 UTC] derick@php.net
I added an error of level E_NOTICE for this.

Derick
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 29 00:03:33 2022 UTC