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));
Comments
Post a Comment