Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change timestamp of SQLITE DB to local timestamp

I insert a record into sqlite database a date by current_timestamp. The idea ist, NOT to set the time manually. Now, the thing is, that my date in the database is 5.30 hours after inserting. Any ideas, how to walk around or fix that?

like image 563
Vaishali Pawar Avatar asked Feb 11 '13 14:02

Vaishali Pawar


1 Answers

use :

CREATE TABLE table 
( ... 
, yourColumnName DATETIME DEFAULT (DATETIME(CURRENT_TIMESTAMP, 'LOCALTIME'))
, ...
);
like image 59
AsafK Avatar answered Sep 27 '22 20:09

AsafK