Android Question SQLite & Dates

luke2012

Well-Known Member
Licensed User
Longtime User
Hi to all,
I have a problem using SQLite Date() funcion.

I have a [date] field in my db that is automatically filled by the expression : Date('Now')
If a insert a new record it work fine until 23:59 (the field it's filled by today date).

At 00:01 AM if I insert a new record the field is filled by the yesterday date not with the new date.
It's a time zone problem about SQLite Date() function ?
 

luke2012

Well-Known Member
Licensed User
Longtime User
Handle the date and time values in your code. Use DateTime.Date(DateTime.Now) and add the value to the database.

Or use ticks instead of strings.

Thanks for your reply Erel.
In which format I have to save the date within a SQLite [date] field ?
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
Thanks to all for replies :)
I'm using this expression to obtain the today date : DateTime.Date(DateTime.now)

The time zone is correct with the correct time zone or I have to set it?
 
Upvote 0
Top