Re: [sqlite] Bug in date() function ??

2009-10-13 Thread Pavel Ivanov
It looks pretty interesting that no matter if date() function works as is now or with some heuristics applied the following equations are not always true: date(some_date, '-1 month', '+1 month') = some_date date(some_date, '-1 month') = date(some_date, '-1 day', '-1 month', '+1 day') Looks like

Re: [sqlite] Bug in date() function ??

2009-10-13 Thread Nicolas Williams
On Tue, Oct 13, 2009 at 03:30:44PM -0400, D. Richard Hipp wrote: > Begin with 2001-03-31 > Add 1 to 03, yielding 2001-04-31 > 04-31 means the 31st day from the beginning of april: 2001-05-01 > > Begin with 2001-03-31 > Subtract 1 from 03 yielding 2001-02-31. > 02-31 means the 31st day from the

Re: [sqlite] Bug in date() function ??

2009-10-13 Thread D. Richard Hipp
On Oct 13, 2009, at 3:17 PM, Keith Roberts wrote: > On Tue, 13 Oct 2009, D. Richard Hipp wrote: > >> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> >> From: D. Richard Hipp <d...@hwaci.com> >> Subject: Re: [sqlite] Bug in date() function ?

Re: [sqlite] Bug in date() function ??

2009-10-13 Thread Keith Roberts
On Tue, 13 Oct 2009, D. Richard Hipp wrote: > To: General Discussion of SQLite Database <sqlite-users@sqlite.org> > From: D. Richard Hipp <d...@hwaci.com> > Subject: Re: [sqlite] Bug in date() function ?? > > > On Oct 13, 2009, at 12:57 PM, Keith Roberts wrote

Re: [sqlite] Bug in date() function ??

2009-10-13 Thread Igor Tandetnik
Keith Roberts wrote: > From: http://www.sqlite.org/lang_datefunc.html > > "Thus, for example, the data 2001-03-31 modified by '+1 > month' initially yields 2001-04-31, but April only has 30 > days so the date is normalized to 2001-05-01." > > When I add '+1 month' to the

Re: [sqlite] Bug in date() function ??

2009-10-13 Thread D. Richard Hipp
On Oct 13, 2009, at 12:57 PM, Keith Roberts wrote: > Just been messing about with the date functions, and there > appears to be an inconsistency when adding a month > modifier. I'm running Fedora 10. > > From: http://www.sqlite.org/lang_datefunc.html > > "Thus, for example, the data 2001-03-31

[sqlite] Bug in date() function ??

2009-10-13 Thread Keith Roberts
Just been messing about with the date functions, and there appears to be an inconsistency when adding a month modifier. I'm running Fedora 10. [root ~]# sqlite3 SQLite version 3.5.9 Enter ".help" for instructions sqlite> SELECT date('2001-03-31'); 2001-03-31 sqlite> SELECT date('2001-03-31',