Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-23 Thread Ralf Junker
>> > So make the wiki available for download. ;) >> >> I would like this too. ;) >> >> Often I'm working without an internet connection and a having a local >> copy of the Wiki would be extremely useful. >> > >Been working on this for years. Literally. I just never seem to >find the time to c

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-22 Thread drh
"McDermott, Andrew" <[EMAIL PROTECTED]> wrote: > Hi, > > > [EMAIL PROTECTED] wrote: > > > Guess you can't please everybody :-) Right now we have some > > > documentation in the source tree and some on the wiki, > > which I suppose > > > is guaranteed to please nobody. > > > > So make the

RE: [sqlite] Precision of dates stores as Julian "real"

2007-02-22 Thread McDermott, Andrew
Hi, > [EMAIL PROTECTED] wrote: > > Guess you can't please everybody :-) Right now we have some > > documentation in the source tree and some on the wiki, > which I suppose > > is guaranteed to please nobody. > > So make the wiki available for download. ;) I would like this too. ;) Ofte

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread Martin Jenkins
[EMAIL PROTECTED] wrote: Guess you can't please everybody :-) Right now we have some documentation in the source tree and some on the wiki, which I suppose is guaranteed to please nobody. So make the wiki available for download. ;) Martin -

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread Dennis Cote
[EMAIL PROTECTED] wrote: Sure you can. You just have to put the expression in parentheses (to avoid a parsing conflict). Try this: CREATE TABLE test1( date TEXT DEFAULT (strftime('%Y-%m-%d %H:%M:%f', 'now')), dummy int ); INSERT INTO test1(dummy) VALUES(1); SELECT

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread P Kishor
On 2/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "P Kishor" <[EMAIL PROTECTED]> wrote: > > is it possible to add usage such as the above, and many, many > wonderful SQL suggestions routinely provided by Igor Tandetnik (thanks > Igor!) to the syntax docs in the form of user-submitted comme

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread drh
"P Kishor" <[EMAIL PROTECTED]> wrote: > > is it possible to add usage such as the above, and many, many > wonderful SQL suggestions routinely provided by Igor Tandetnik (thanks > Igor!) to the syntax docs in the form of user-submitted comments? > I was trying to move all of the documentation int

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread P Kishor
On 2/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Dennis Cote <[EMAIL PROTECTED]> wrote: > > The problem is that you can't use a function like strftime as the > default value for a column when you create a tbale. It only accepts > NULL, a string constant, a number, or one of the magic curr

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread drh
Dennis Cote <[EMAIL PROTECTED]> wrote: > > The problem is that you can't use a function like strftime as the > default value for a column when you create a tbale. It only accepts > NULL, a string constant, a number, or one of the magic current_* values. > Sure you can. You just have to put th

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread Dennis Cote
[EMAIL PROTECTED] wrote: This isn't a bug. The magic current_timestamp keyword is really an alias for "datetime('now')". And datetime('now') returns you a text string in the format "YY-MM-DD HH:MM:SS". Yes, this means that the seconds have been rounded to the nearest whole second. But that

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread Martin Jenkins
Doug Currie wrote: Thanks for the links. I repeated Joe's test on my XP box and plotted the results - it appears that the time is adjusted by up to +/- 800us every 12/64ths of a second and interpolated between. Interesting stuff, though I'm not convinced that hectonanoseconds will catch on. :

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread drh
Dennis Cote <[EMAIL PROTECTED]> wrote: > > sqlite> select strftime('%f', 'now'); > 0.622 > sqlite> select strftime('%f', current_timestamp); > 34.000 > > You might want to file a bug report about this. > This isn't a bug. The magic current_timestamp keyword is really an alias

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread Doug Currie
On Wednesday, February 21, 2007 Martin Jenkins wrote: > Joe Wilson wrote: >> So this machine's minimum timer resolution is 0.0155 seconds, >> or 15.5 milliseconds. > XP box? > XP & timers: http://www.lochan.org/2005/keith-cl/useful/win32time.html Also see the comments about timeBeginPeriod()

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread Dennis Cote
Tom Olson wrote: Thank you for the reply. I ran the select statement you sent me as well as testing it with 'now' and both do indeed show the fractional seconds, however if I use current_timestamp I do not see the fractional seconds. using 'now' should suffice as a workaround. Curious though?

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-21 Thread Tom Olson
Dr. H, Thank you for the reply. I ran the select statement you sent me as well as testing it with 'now' and both do indeed show the fractional seconds, however if I use current_timestamp I do not see the fractional seconds. using 'now' should suffice as a workaround. Curious though? Kind Rega

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-20 Thread Martin Jenkins
Joe Wilson wrote: So this machine's minimum timer resolution is 0.0155 seconds, or 15.5 milliseconds. XP box? XP & timers: http://www.lochan.org/2005/keith-cl/useful/win32time.html Martin - To unsubscribe, send email

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-20 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > A double is sufficient to store the current time to with about > 25 microseconds. If you use 'now' to get the current time, the > date functions try to capture the current time to this precision. > That is implemented in the os_XXX.c layer. It's system dependent. >

Re: [sqlite] Precision of dates stores as Julian "real"

2007-02-20 Thread drh
Tom Olson <[EMAIL PROTECTED]> wrote: > Hello, > > I know that SQLite uses a 64-bit floating point type to store Julian date > information. Is this accurate to the second or a fraction of a second? > > I was doing some testing and tried to format a date using strftime() method > with the %f optio

[sqlite] Precision of dates stores as Julian "real"

2007-02-20 Thread Tom Olson
Hello, I know that SQLite uses a 64-bit floating point type to store Julian date information. Is this accurate to the second or a fraction of a second? I was doing some testing and tried to format a date using strftime() method with the %f option and I was unable to find a date that kept any mi