php not converting dates -


this might simple, still need this.

i have portion of php code:

$end = null;  if (isset ($_post['end'])){     $end = date_format($_post['end'], "y-m-d h:i"); } 

where $_post['end'] date , time in format dd-mm-yyyy hh:mm. problem is, can guess, doesn't transform input y-m-d h:i format, doesn't anything. i've followed i've seen in code indeed work. doing wrong here?

ignore fact don't check if input written, assume be.

this because date_format accepts object , not string. should use function date , pass it's second argument timestamp.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -