Difference Between DateTime( 'now', 'localtime' ) and DateTime( 'now') SQLITE -


i use datetime('now') store current time query execution took place, faced problem time saving in gmt (or other phone's current time) noticed effect ( wrong date) not happening in tables (which have defualt value of datetime( 'now')..)

my question if have column date time in database , want have default value current time on phone (when query execution took place) should use datetime( 'now', 'localtime' ) default value date column ?

thank you.

datetime('now') returns device thinks current time in gmt is.

datetime('now', 'localtime') returns device thinks current time in device thinks current time zone is.

in general, storing times in gmt preferred because not have bother changing time zones.


Comments

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -