vendredi 19 juin 2015

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

i always use DateTime('now') to store the current time that the query execution took place, but recently i faced a problem with this which is the time is saving in GMT (or other than the phone's current time) but also i noticed that this effect ( wrong date) is not happening in all my tables (which all have a defualt value of DateTime( 'now')..)

my question is if i have a column date time in my database and want to have a default value for the current time on the phone (when query execution took place) should i always use DateTime( 'now', 'localtime' ) as a default value for date column ?

Thank you.

Aucun commentaire:

Enregistrer un commentaire