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 <[email protected]>
>> From: D. Richard Hipp <[email protected]>
>> Subject: Re: [sqlite] Bug in date() function ??
>>
>>
>> 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 modified by '+1
>>> month' initially yields 2001-04-31, but April only has 30
>>> days so the date is normalized to 2001-05-01."
>>
>> Did you happen to read the previous sentence in the documentation?
>
> Yes, I've read it again Richard. As the '+1 month' modifier
> modified the date by adding 31 days to normalise the date
> upwards, I expected the '-1 month' modifier to work in a
> similar fashion, and normalise the date *downwards* also by
> an interval of 31 days.

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 beginning of february:  2001-03-03

>
> Kind Regards,
>
> Keith Roberts
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

D. Richard Hipp
[email protected]



_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to