Lang thang tìm được tài liệu này hay:
Có thể tìm hiểu thêm các nội dung khác ở trang này
I worked with date time data in PHP and MySQL
1. Format at view:
a. Loading from the database: YYYY-mm-dd HH:mm:ss
b. Clicking the datetimepicker, and change to: yyyy/MM/dd hh:mm:ss
2. Save it into database with date("Y-m-d H:i:s", strtotime($this->input->post('created_date'))
3. Update datetime field in table:
For example:
UPDATE model SET first_published='2016-03-06 16:14:04' WHERE id=9;
CREATE USER 'dbadmin'@'localhost' IDENTIFIED BY 'admin';
UPDATE user SET real_name='Tung Nguyen' WHERE username='nvntung';