Re: [ormlite:bugs] #135 Date persister stores without time zone

155 views
Skip to first unread message

Gray Watson

unread,
Feb 3, 2013, 5:37:46 PM2/3/13
to ormlit...@googlegroups.com, ormli...@googlegroups.com
I'm trying to cross off some last minute bugs today and [finally] put out version 4.43.

One of the bugs pointed out that the date string format (used by Android for all Date fields) did not include the timezone. A big miss.

As a fix, I've made the default format to be "yyyy-MM-dd HH:mm:ss.SSS Z" while still supporting the old format "yyyy-MM-dd HH:mm:ss.SSSSSS". It will first try to parse the date with the timezone and if that fails will use the old format. Any new rows or updates will be saved _with_ the timezone.

Comments about this? Is it going to be bad to have rows with different date formats? Is that going to make it harder to do queries or something?
gray

On Nov 12, 2012, at 1:39 PM, Paul Lammertsma wrote:

> bugs:135 Date persister stores without time zone
>
> Status: open Created: Mon Nov 12, 2012 06:39 PM UTC by Paul Lammertsma Last Updated: Mon Nov 12, 2012 06:39 PM UTC Owner: nobody
>
> I'm not sure exactly how this is stored in other databases, but in Sqlite (e.g. on Android), Dates are stored as YYYY-MM-DD HH:MM:SS. This works fine until the device's time zone is changed.
>
> It would be an improvement to include the time zone, or store the date as a UTC timestamp.
>
> Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/ormlite/bugs/135/
>
> To unsubscribe from further messages, please visit https://sourceforge.net/auth/prefs/
>

Gray Watson

unread,
Feb 4, 2013, 12:21:27 AM2/4/13
to ormlit...@googlegroups.com, ormli...@googlegroups.com
Well it turns out that I need to withdraw this format. TUrns out that Sqlite does not support the timezone internally. We are going to have to leave the date string format without a timezone and force the users who need the timezone to set their own format.

gray
Reply all
Reply to author
Forward
0 new messages