Posted By

sekihin on 03/09/09


Tagged

php


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

jfherring
jamesming
rezzz


Converting PHP Date dd/mm/yyyy to SQL date YYYY-MM-DD


 / Published in: PHP
 

  1. $Date = date('Y-m-d', strtotime($Date));

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Vordreller on March 17, 2009

Be carefull here, the PHP date format is dependant on your OS version.

I'm using Windows, Dutch version, which means my time notation is MM/DD/YYYY

When I tried to enter 30 December 2008 as 30/12/2008 and then used it on that snip of yours, the echo printed 1970-01-01 When using 12/30/2008, I got the correct output.

You need to login to post a comment.