<[EMAIL PROTECTED]> wrote:
> Hi
>
> Can somebody give any explain to this please.
>
> sqlite> select date("2006-03-31");
> 2006-03-31
> --> correct
>
> sqlite> select date("2006-03-31", "-1 month");
> 2006-03-03
> --> not correct
>
"2006-03-31", "-1 month" is "2006-02-31". Except
"2006-02-31" is really "2006-03-03".
What were you expecting the results to be? How do
you compute one month before 2006-03-31? If you
were expecting 2006-02-28, then wouldn't
2006-03-31 -1 month
2006-03-30 -1 month
2006-03-29 -1 month
2006-03-28 -1 month
All give the same answer? That seems wrong. Or is it?
The bottom line is that "one month ago" or "one month from now"
is a fuzzy concept since months vary in length.
What do you expect to get from this:
2008-02-29 +1 year
Should that be 2009-02-28 or 2009-03-01? SQLite picks
the latter. But you could argue either one, I suppose.
--
D. Richard Hipp <[EMAIL PROTECTED]>
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------