In codeigniter before database insertion, datetime is correct.
05-08-2019 17:30:00
But in database it's
05-08-2019 5:30:00
I tried to add timestamp in config.php.
date_default_timezone_set('Asia/Kolkata');
But no change in this behavior.
Try this,
$data['cur_time']=date('Y-m-d H:i:s');//changes `H` & `Y`
$this->db->insert('tb_user', $data);
Hwill give you Hour (00 to 23)
hwill give you Hour (00 to 12)
YYear as a numeric, 4-digit value
yYear as a numeric, 2-digit value
date_format()code how you insert it in DB?timestampauto update, then check your server timezone.