Re: [sqlite] Time Precision

2018-08-26 Thread dmp
Keith Medcalf wrote: > Are you running Windows or Unix? I am sending this to you as I was just looking > into this again and although SQLite maintains time internally with a millisecond > precision, the API used on Windows to read the time is limited by the Clock > Resolution (usually about 16.5

Re: [sqlite] Time Precision

2018-08-26 Thread Keith Medcalf
Are you running Windows or Unix? I am sending this to you as I was just looking into this again and although SQLite maintains time internally with a millisecond precision, the API used on Windows to read the time is limited by the Clock Resolution (usually about 16.5 ms). If you are using

Re: [sqlite] Time Precision

2018-07-06 Thread dmp
danap wrote: > SELECT CAST((SELECT (julianday('now', 'localtime') - > julianday('1970-01-01'))*24*60*60*1000) AS INTEGER); Keith wrote: > Are you sure you want to be mixing up timezones? > > julianday('1970-01-01') returns the julianday timestamp > for 1970-01-01 00:00:00 GMT julianday('now',

Re: [sqlite] Time Precision

2018-07-05 Thread Keith Medcalf
] On Behalf Of dmp >Sent: Monday, 2 July, 2018 11:07 >To: sqlite-users@mailinglists.sqlite.org >Subject: Re: [sqlite] Time Precision > >> Igor wrote: >> select (julianday('now') - julianday('1970-01-01'))*24*60*60*1000 > >> Keith wrote: >> select (julianday() - 24

Re: [sqlite] Time Precision

2018-07-02 Thread dmp
> Igor wrote: > select (julianday('now') - julianday('1970-01-01'))*24*60*60*1000 > Keith wrote: > select (julianday() - 2440587.5) * 86400.0 Both of these got me on my way, Igor's a little more clearer. I'll doing a little more checking to insure the solution below is correct, but seems good.

Re: [sqlite] Time Precision

2018-07-01 Thread David Burgess
Too long since I have coded for windows. BUT getting a accurate time/interval from a loaded windows system is non-trivial. The multimedia timers are ok (from memory). ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] Time Precision

2018-07-01 Thread Keith Medcalf
You can make a user-defined function on Windows that returns the UnixTime to the limit of Accuracy of the underlying hardware/software (100 huns max) and to the limit of precision of the IEEE754 double precision floating point format with the following (so an accuracy of 100 nanoseconds with a

Re: [sqlite] Time Precision

2018-07-01 Thread Keith Medcalf
The "unixepoch" time used by SQLite is an "integer" in whole seconds of precision. ISO-8601 datetime strings are also "by default" generated in seconds of precision. If you use strftime rather than datetime then the ISO8601 strings can be read with "unlimited" precision and written with

Re: [sqlite] Time Precision

2018-07-01 Thread Igor Tandetnik
On 7/1/2018 2:37 PM, danap wrote: The time precision treated with and defined, ISO-8601, seems to be with regard to seconds. Storage of an Integer for time as an example in SQLite: sqlite> SELECT STRFTIME('%s', 'now', 'localtime'); 1530446557 A 10 digit value. The issue I'm having is with