By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,890 Members | 1,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,890 IT Pros & Developers. It's quick & easy.

why doesn't strtotime('') return -1

P: n/a
instead of the warning message:
strtotime(): Called with empty time parameter in ...

Any good reason?

Thanks,
alejandro

Jul 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Tue, 12 Aug 2003 06:42:28 +1000, Alejandro Dubrovsky
<s3*****@student.uq.edu.au> wrote:

Subject: Re: why doesn't strtotime('') return -1

[ Please don't ask questions in the subject, put them in the body ]
instead of the warning message:
strtotime(): Called with empty time parameter in ...


It shouldn't return -1, it should return midnight on the beginning of the
current day, read the linked page 'Date Input Formats'.

That warning is spurious though, since empty string is defined as a valid
input.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 16 '05 #2

P: n/a
Alejandro Dubrovsky wrote:
instead of the warning message:
strtotime(): Called with empty time parameter in ...

Any good reason?

Thanks,
alejandro


Because strtotime requires a string, and you're passing it '' which is
the equivalent of nothing. Try ' ' instead.

Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.