On 18 Oct 2018, at 2:28pm, Fábio Pfeifer <fmpfei...@gmail.com> wrote:

> When working with Apple iOS databases, I found something strange when dealing 
> with dates.

I suspect you are you are referring to a library routine which is used by lots 
of iOS software, but can you give us a specific App which exhibits this bug, 
and an easy way to find a database file from it ?

> Apple iOS databases store dates as seconds from
> 2001-01-01 (31 years after unix epoch). But from 2015-03-02 to 2016-02-29 
> there is a offset of one day if '31 years' modifier is used.

I get the following:

SQLite version 3.24.0 2018-06-04 14:10:15
sqlite> select datetime(446860801, 'unixepoch', '31 years') as date1;
2015-03-01 00:00:01
sqlite> SELECT datetime(446860801+60*60*24, 'unixepoch', '31 years') as date2;
2015-03-01 00:00:01
sqlite> SELECT datetime(446860801+60*60*24*2, 'unixepoch', '31 years') as date3;
2015-03-02 00:00:01
sqlite> 

Just for reference, 2015 was not a leap year, and 2016 was a leap year.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to