Transform MM/DD/YYYY to SQL date format


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /* Go from MM/DD/YYYY form input to YYYY-MM-DD */
  2.  
  3. $dateArray=explode('/',$_POST[theInputDate]);
  4. $date = $dateStartArray[2]."-".$dateStartArray[0]."-".$dateStartArray[1];

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.