View Full Version : converting DD-MM-YYY to time

01-06-2012, 01:44 PM
Can anyone please tell me how I convert DD-MM-YYY (text) to TIME (unix)

thought I'd say that I have this line at the top of all my pages, just in case it means a different code.

date_default_timezone_set('Europe/London'); //### Set the default timezone

01-06-2012, 03:52 PM
d-m-y is a valid gnu format. Use

$timestamp = strtotime('1-1-2012');

If its already in SQL you can call the databases method of conversion. MySQL uses UNIX_TIMESTAMP that should accept a valid datetime type in SQL.