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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -