Jump to content

strtotime not working


Lucky1000

Recommended Posts

Hi

 

I am new to PHP and trying to convert a date from a registration form (in the form 01/01/2011) to Y-m-d so that it can be stored in the database.

 

This is the code I have, pretty sure it worked before but not it has stopped working! Any ideas?

 

$dateformat = $_POST['dob'];

$correctformat = date('Y-m-d',strtotime($dateformat));

 

I have checked what $_POST['dob'] is printing and that is correct, however the $correctformat is printing 1970-01-01 everytime.

 

Any help would be greatly apreciated.

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/250369-strtotime-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.