I have one field displaying date and time in following format:
30/01/2011, 4:57 pm
I want to store this in mysql using data type datetime.
After getting value from post, I try to store it in database but its storing 0000-00-00 00:00:00 in table.
How can I store above specified values?
You can use
dateandstrtotimelike this:Result:
Working Example
Now you can use the
$to_mysql_datevariable to insert the date in MySQL-friendly format 🙂More Info: