KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I cant understand this - why does the following occur? echo date("d-m-Y", strtotime($str)); $str = '214454'; // Produces todays date $str = '333333'; // Produces 1-1-1970 $str = 'a' (or ANY single char) // Produces tomorrows date $str = 'aa' (or ANY double char) // Produces 1-1-1970 OR just returning the strtotime function echo strtotime($str); $str = '214454'; // Produces todays date $str = '333333'; // returns false $str = 'a' (or ANY single char) // Produces tomorrows date $str = 'aa' (or ANY double char) // returns false These values came from some testing I was doing, to try and work out how/why certain values were being returned from a specific function. Its causing my function to fail - because you would assume "a" (or any single char) to be returned as a false incorrect date.
Tags (comma-separated)
Save Edits
Cancel