php - Inserting this timestamp into MySQL timestamp column -


i have series of data need insert mysql table using php (codeigniter).

problem: 1 of data timestamp looks 06/01/12 01:43 pm. when insert mysql timestamp column, becomes 0000-00-00 00:00:00. how can format original format can insert correctly timestamp col?

if wanted perform transformation via php, it's quite straightforward:

$oldformat = "06/01/12 01:43 pm"; $newformat = date("y-m-d h:i:s", strtotime($oldformat)); 

strtotime docs

date docs


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -