View Full Version : Convert date (DD/MM/YYYY) into timestamp

09-13-2011, 12:10 AM
I need to convert a date in the format dd/mm/yyyy (date format got from jQuery datepicker) and i need to convert it to a timestamp.

I tried

but that didnt work, how would i do this?

09-13-2011, 12:16 AM

strtotime($_POST['datepicker']) should return a valid timestamp I think. I would check it though.

Easy way to check:

// Both should echo the same thing
echo $_POST['datepicker']."\n";
echo date("d/m/Y", strtotime($_POST['datepicker']));

09-13-2011, 12:39 AM
Ahh, that worked, thank you :)

09-13-2011, 01:18 AM
No problem :). The manual has a full list of time/date formats strtotime will accept, just as an FYI :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum