0

I have the following date "25/01/2016 15:49:20" as $my_time

Performing the following function on the date: strtotime($my_time); returns false. Now I have looked through other threads in relation to this, but from what I can garner this is a valid date/time for the strtotime(); function. Could anyone suggest what the issue is here?

Liam Fell
  • 1,308
  • 3
  • 21
  • 39
  • 2
    There is no 25th month. Basically that format is not valid. Use DateTime() to parse that date and get a Unix timestamp from it. – John Conde Jan 25 '16 at 16:40
  • Possible duplicate of [http://stackoverflow.com/questions/2891937/strtotime-doesnt-work-with-dd-mm-yyyy-format](http://stackoverflow.com/questions/2891937/strtotime-doesnt-work-with-dd-mm-yyyy-format) – Rajdeep Paul Jan 25 '16 at 16:44
  • According to http://php.net/manual/en/datetime.formats.date.php, the format you have tried to specified is not valid. It is a mix between American month, day and year ("mm/dd/y") and Day, month and four digit year, with dots, tabs or dashes ("dd [.\t-] mm [.-] YY"). You can either switch the order of dd/mm or switch your "/" to "-". – Scott Jan 25 '16 at 16:45

0 Answers0