nick
unread,Sep 6, 2009, 6:20:16 AM9/6/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlitepersistentobjects-user
When storing an [NSDate] using sqlitepo, the stored value differs
depending on whether the iPhone has 24-Hour time switched on or off
(under Settings>General>Date & Time).
In 12-Hour time mode, the string written to the table is: 2009-09-06
01:09:11 PM.8550
In 24-Hour time mode, the string written to the table is: 2009-09-06
13:09:11.8550
This creates problems when retrieving and comparing date fields later.
For example, the following code returns entries when 24-Hour time mode
is on, but no entries when it's turned off:
todayTasks = [Task findByCriteria: @"WHERE date(due) BETWEEN
'1980-01-01' AND date('now','localtime') ORDER BY due"];
Is this a bug, and is there a way I can workaround it to always store
dates in 24-hour time mode? Very grateful for any help.