顯示具有 date 標籤的文章。 顯示所有文章
顯示具有 date 標籤的文章。 顯示所有文章

2012年12月27日 星期四

Local datetime in SQLite




This article shows how to get the local date time from SQLite


When we run the following SQL, it returns the UTC time..

select datetime('now');

2012-12-26 16:01:07




To return the local time, you can add the the parameter 'localtime' 

select datetime('now', 'localtime');

2012-12-27 00:01:07