Welcome Guest, Not a member yet? Register   Sign In

hi please tell me how do i insert values in database field with type timestamp. Like i am doing this way in codeigniter
             'valid_from'=>date('Y-m-d H:i:s','1299762201428'),
but in databse i am getting 0s (0000-00-00 00.00.00)

You are passing a string into the date() function, which requires a timestamp, or at least a number. Plus your unix timestamp is 3 digits too long.
'valid_from'=>date('Y-m-d H:i:s','1299762201428')
// should be more like this...
'valid_from'=>date('Y-m-d H:i:s', 1299762201) // no quotes
// or...
'valid_from'=>date('Y-m-d H:i:s', strtotime('2009-02-01'))

Theme © iAndrew 2016 - Forum software by © MyBB