I get the date of this format
string(10) "19 05 2016" I need to convert it to unix format so I try
var_dump(strtotime($post["Serial"]["dataseria"])) getting
bool(false) why not tell me? And how to correct.
I get the date of this format
string(10) "19 05 2016" I need to convert it to unix format so I try
var_dump(strtotime($post["Serial"]["dataseria"])) getting
bool(false) why not tell me? And how to correct.
Apparently, your date does not match the format expected by the strtotime function. I think it is necessary to specify the format explicitly. For example:
$date = \DateTime::createFromFormat('dm Y', '19 05 2016'); echo($date->getTimestamp()); Working example on IDEOne.
Source: https://ru.stackoverflow.com/questions/527682/
All Articles