Re: [sqlite] DateTime kind stored as undefined

2017-12-21 Thread mnie
Hi Cezary, indeed I try your piece of code (to retrieve data) and it works as expected, kind is stored in db. It seems that it is a problem with dapper instead of SqLite. So I will bump issue in Dapper (https://github.com/StackExchange/Dapper/issues/571). Many thanks for help! Best regards,

Re: [sqlite] DateTime kind stored as undefined

2017-12-16 Thread Cezary H. Noweta
Hello, > my connection string looks like this: > *var connection = new SQLiteConnection("DateTimeKind=Utc;Data > Source=:memory:");* > Here is a blog post about it (settig datetimekind in utc for sqlite) on > which I based: >

Re: [sqlite] DateTime kind stored as undefined

2017-12-14 Thread Cezary H. Noweta
I'm sorry -- the following post was sent to a private e-mail by an accident: Hello, On 2017-12-13 12:51, Michał Niegrzybowski wrote: > I have a table which has a column of type DateTime in my code I insert > there an actual UTC Date (which is not the same as my local time). When I > want to

Re: [sqlite] DateTime kind stored as undefined

2017-12-13 Thread Simon Slavin
On 13 Dec 2017, at 11:51am, Michał Niegrzybowski wrote: > I have a table which has a column of type DateTime in my code I insert > there an actual UTC Date (which is not the same as my local time). When I > want to gather previously added record, my record

Re: [sqlite] DateTime to bigint

2017-12-08 Thread Tibor Balog
Well, coming from a strongly typed education this is too much freedom for me. - Just kidding - Thanks for the vital info, appreciated. -Ursprüngliche Nachricht- From: Keith Medcalf Sent: Friday, December 8, 2017 7:14 PM To: SQLite mailing list Subject: Re: [sqlite] DateTime

Re: [sqlite] DateTime to bigint

2017-12-08 Thread Keith Medcalf
s.sqlite.org] On Behalf Of Paul Sanderson >Sent: Friday, 8 December, 2017 10:17 >To: SQLite mailing list >Subject: Re: [sqlite] DateTime to bigint > >Hi Tibor > >Your date format is windows ticks, i.e. 100 nano seconds intervals >since >01/01/0001 > >You can c

Re: [sqlite] DateTime to bigint

2017-12-08 Thread Tibor Balog
: [sqlite] DateTime to bigint Hi Tibor Your date format is windows ticks, i.e. 100 nano seconds intervals since 01/01/0001 You can convert it as follows SELECT (StrfTime('%s', '2004-08-05') + 62135596800) * 1000 AS Ticks where StrfTime('%s', '2004-08-05') is the number of seconds between

Re: [sqlite] DateTime to bigint

2017-12-08 Thread Paul Sanderson
Hi Tibor Your date format is windows ticks, i.e. 100 nano seconds intervals since 01/01/0001 You can convert it as follows SELECT (StrfTime('%s', '2004-08-05') + 62135596800) * 1000 AS Ticks where StrfTime('%s', '2004-08-05') is the number of seconds between the provided date and 1/1/1970

Re: [sqlite] Datetime / Transactions / CLI

2017-11-28 Thread Stephen Chrzanowski
Although I don't do many long length transactions for date and times, I kind of like the idea of having the control of over how the library allows you to chose which way the dates and times are going to work. Default to the current model, of course, to allow for backward compatibility, but, either

Re: [sqlite] Datetime / Transactions / CLI

2017-11-28 Thread nomad
On Tue Nov 28, 2017 at 10:34:03AM -0700, Keith Medcalf wrote: > > Datetime functions (that is, what constitutes "now") was, by default, > step-stable. The value is cached within the VDBE (statement object) > on its first use per-step and retains the same value until the VDBE > code yields a row.

Re: [sqlite] Datetime / Transactions / CLI

2017-11-28 Thread Simon Slavin
On 28 Nov 2017, at 5:34pm, Keith Medcalf wrote: > This would indicate that "now" has statement-stability and not > transaction-stability, which matches with my observations. You’re right, I was wrong. Thanks for the correction. Simon.

Re: [sqlite] Datetime / Transactions / CLI

2017-11-28 Thread Keith Medcalf
ginal Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin >Sent: Tuesday, 28 November, 2017 09:02 >To: SQLite mailing list >Subject: Re: [sqlite] Datetime / Transactions / CLI > > > >On 28 Nov 2017, at 3:50pm, no...@nul

Re: [sqlite] Datetime / Transactions / CLI

2017-11-28 Thread Simon Slavin
On 28 Nov 2017, at 3:50pm, no...@null.net wrote: > Can someone point me to the documentation for behaviour of date/time > functions inside transactions? In my code it appears time is frozen. Correct. The value of 'now' is frozen at the time a transaction begins. This is to ensure that if

Re: [sqlite] datetime vs strftime?

2014-09-26 Thread Clemens Ladisch
Andy Bradford wrote: > sqlite> SELECT strftime('%Y-%m-%d %H:%M:%S',1); > -471-11-25 12:00:00 > > Is this perhaps undefined behavior because it does say %Y has a range of > --? Yes. (strftime always outputs the year with four characters, whatever they might be.) Regards, Clemens

Re: [sqlite] datetime, its customary column affinity, and storage class info

2012-10-22 Thread John Gabriele
On Mon, Oct 22, 2012 at 11:38 PM, Simon Slavin wrote: > > On 23 Oct 2012, at 3:42am, John Gabriele wrote: > >> Which column affinity is most customary to use for storing "-MM-DD >> HH:MM:SS" datetime values? > > Text. They are just text. As you've

Re: [sqlite] datetime, its customary column affinity, and storage class info

2012-10-22 Thread Simon Slavin
On 23 Oct 2012, at 3:42am, John Gabriele wrote: > Which column affinity is most customary to use for storing "-MM-DD > HH:MM:SS" datetime values? Text. They are just text. As you've figured out, SQLite has no datetime datatype. > The docs at

Re: [sqlite] datetime, its customary column affinity, and storage class info

2012-10-22 Thread Igor Tandetnik
John Gabriele wrote: > Which column affinity is most customary to use for storing "-MM-DD > HH:MM:SS" datetime values? Text. > I tried this: > > ~~~sql > create table t1 ( > id integer primary key, > this_date text, > that_date int, > other_date none); > > insert

Re: [sqlite] datetime, its customary column affinity, and storage class info

2012-10-22 Thread Richard Hipp
On Mon, Oct 22, 2012 at 10:42 PM, John Gabriele wrote: > Hi, > > Which column affinity is most customary to use for storing "-MM-DD > HH:MM:SS" datetime values? > I always use DATE or DATETIME or TIME, depending on what I'm storing. I believe these always have affinity

Re: [sqlite] datetime question

2012-08-22 Thread Keith Medcalf
> create table test( Date datetime); Datetime is not a data type and therefore has numeric affinity. > insert test now(); sqlite> select now(); Error: no such function: now What is function now and what does it return? > select date+2 as bbb,date-12 as cc from test; > the result is >

Re: [sqlite] datetime question

2012-08-22 Thread Simon Slavin
On 23 Aug 2012, at 3:14am, YAN HONG YE wrote: > create table test( Date datetime); > insert test now(); > select date+2 as bbb,date-12 as cc from test; > the result is > 2014,2000 > I wanna know how to add any day use sql command There is no field type 'datetime'. Dates

Re: [sqlite] datetime

2011-12-20 Thread Stephen Chrzanowski
That would make sense. Thank you for clearing that up. On Tue, Dec 20, 2011 at 8:50 AM, Igor Tandetnik wrote: > Stephen Chrzanowski wrote: > > I live in GMT-5 (America/Toronto). Current time is 8:06am, which should > be > > 13:06Z. However,

Re: [sqlite] datetime

2011-12-20 Thread Igor Tandetnik
Stephen Chrzanowski wrote: > I live in GMT-5 (America/Toronto). Current time is 8:06am, which should be > 13:06Z. However, according to this: > > select datetime('now','localtime'),datetime('now','utc'); > datetime('now','localtime')datetime('now','utc') > 2011-12-20

Re: [sqlite] datetime

2011-12-20 Thread Stephen Chrzanowski
That returned the expected results. So in other words, even though 'UTC' is a valid option, it shouldn't be used? On Tue, Dec 20, 2011 at 8:41 AM, Kit wrote: > 2011/12/20 Stephen Chrzanowski : > > I live in GMT-5 (America/Toronto). Current time is

Re: [sqlite] datetime

2011-12-20 Thread Kit
2011/12/20 Stephen Chrzanowski : > I live in GMT-5 (America/Toronto).  Current time is 8:06am, which should be > 13:06Z.  However, according to this: > > select datetime('now','localtime'),datetime('now','utc'); > datetime('now','localtime')    datetime('now','utc') >

Re: [sqlite] datetime('now') has only per-second resolution?

2011-08-04 Thread Igor Tandetnik
On 8/4/2011 11:35 AM, Sean Hammond wrote: > Hey, I've been recording timestamped log messages in sqlite3 by using > datetime('now') in INSERT queries, e.g.: > > INSERT INTO Logs (...,time) VALUES (...,datetime('now')); > > (The time column has type DATETIME.) That's irrelevant. You are storing

Re: [sqlite] Datetime mystery

2009-10-09 Thread Peter van Dijk
On Oct 8, 2009, at 16:16 , Jay A. Kreibich wrote: > On Thu, Oct 08, 2009 at 08:29:10AM +0200, Fredrik Karlsson scratched > on the wall: > >> Yes, that would have been my guess too, but I am on CET, which I >> understand is UTC+1. CET is CEST in summer, which is UTC+2 Cheers, Peter

Re: [sqlite] Datetime mystery

2009-10-08 Thread Jay A. Kreibich
rlsson <dargo...@gmail.com> To: punk...@eidesis.org, General Discussion of SQLite Database <sqlite-users@sqlite.org> Subject: Re: [sqlite] Datetime mystery -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packe

Re: [sqlite] Datetime mystery

2009-10-08 Thread Fredrik Karlsson
Hi, Yes! That's it! Sorry about the stupid question then.. select datetime('now','localtime'); seems to do what I want. /Fredrik On Thu, Oct 8, 2009 at 9:39 AM, Simon Davies wrote: > 2009/10/8 Fredrik Karlsson : >> Hi, >> >> >> >> On Thu,

Re: [sqlite] Datetime mystery

2009-10-08 Thread Simon Davies
2009/10/8 Fredrik Karlsson : > Hi, > > > > On Thu, Oct 8, 2009 at 12:04 AM, P Kishor wrote: >> On Wed, Oct 7, 2009 at 5:02 PM, Fredrik Karlsson wrote: >>> Dear list, >>> >>> I am sorry if I am asking a FAQ, but what is differnent with

Re: [sqlite] Datetime mystery

2009-10-08 Thread Fredrik Karlsson
Hi, On Thu, Oct 8, 2009 at 12:04 AM, P Kishor wrote: > On Wed, Oct 7, 2009 at 5:02 PM, Fredrik Karlsson wrote: >> Dear list, >> >> I am sorry if I am asking a FAQ, but what is differnent with >> datetime() and time()? >> >>> date # This is the correct

Re: [sqlite] Datetime mystery

2009-10-07 Thread P Kishor
On Wed, Oct 7, 2009 at 5:02 PM, Fredrik Karlsson wrote: > Dear list, > > I am sorry if I am asking a FAQ, but what is differnent with > datetime() and time()? > >> date # This is the correct time on the system > Ons  7 Okt 2009 23:56:36 CEST >> sqlite3 temp.sqlite "SELECT

Re: [sqlite] datetime('now', 'utc') vs. CURRENT_TIMESTAMP

2009-08-26 Thread Wilson, Ronald
> According to http://www.sqlite.org/lang_datefunc.html datetime('now') > returns date and time already as UTC. If you add 'utc' modifier then > it makes datetime() think that it's your local time and convert it to > 'utc' thus adding 4 hours (apparently you're in GMT -4 timezone). Thanks. I

Re: [sqlite] datetime('now', 'utc') vs. CURRENT_TIMESTAMP

2009-08-25 Thread Jay A. Kreibich
On Mon, Aug 24, 2009 at 06:21:49PM -0400, Wilson, Ronald scratched on the wall: > According to the documentation for CURRENT_TIMESTAMP, it should insert > the current UTC date/time: http://www.sqlite.org/lang_createtable.html. > sqlite> select datetime('now', 'utc'); > > 2009-08-25 02:20:10 >

Re: [sqlite] datetime('now', 'utc') vs. CURRENT_TIMESTAMP

2009-08-25 Thread Pavel Ivanov
> Do I misunderstand something fundamental? According to http://www.sqlite.org/lang_datefunc.html datetime('now') returns date and time already as UTC. If you add 'utc' modifier then it makes datetime() think that it's your local time and convert it to 'utc' thus adding 4 hours (apparently you're

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread D. Richard Hipp
On Aug 21, 2009, at 7:22 PM, Jean-Christophe Deschamps wrote: > > US "standard" for date is also completely awkward MM/DD/ as well > as > most european (german for you, french for me) formats. That is a "style" or "convention", not a "standard". The standard is defined here:

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread Jean-Christophe Deschamps
´¯¯¯ >(btw it's the standard datetime format in germany, not custom-designed >:-P) `--- I see this as a confusion between a storage/computational format and human interface representation. US "standard" for date is also completely awkward MM/DD/ as well as most european (german for you,

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread Simon Slavin
On 21 Aug 2009, at 11:37pm, Igor Tandetnik wrote: > t-master wrote: >> the problem is, this db is created by another program and I don't >> have the access to change the format > > What do you mean, don't have access? Can't you just run an UPDATE > statement once,

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread Kit
2009/8/21 t-master : > Hi > I have string in a table representing a DateTime. > The format is 21.08.2009 00:25:00 > And I would like to compare it to "now" > How can I do this? > -- > View this message in context: >

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread t-master
Igor Tandetnik wrote: > > t-master wrote: >> I have string in a table representing a DateTime. >> The format is 21.08.2009 00:25:00 > > I recommend you change the format. Yours is custom-designed to make your > life miserable. > >> And I would like to compare it

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread Igor Tandetnik
t-master wrote: > I have string in a table representing a DateTime. > The format is 21.08.2009 00:25:00 I recommend you change the format. Yours is custom-designed to make your life miserable. > And I would like to compare it to "now" select case when substr(T,

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread Simon Slavin
On 21 Aug 2009, at 7:25pm, t-master wrote: > I have string in a table representing a DateTime. > The format is 21.08.2009 00:25:00 > And I would like to compare it to "now" > How can I do this? If you need to know whether it's before or after instead of just equal, then you're going to need

Re: [sqlite] DATETIME and storage type

2009-07-28 Thread John Stanton
Sqlite does not have a DATETIME type. It stores the decalred type but ignored it. You can use it in your application. Rael Bauer wrote: > Hi, > > If I declare a field as DATETIME default "2001-01-01", ( e.g. alter table > "notes" add column "last_modified" DATETIME default "2001-01-01";)

Re: [sqlite] DATETIME and storage type

2009-07-27 Thread Rich Shepard
On Mon, 27 Jul 2009, Rael Bauer wrote: > If I declare a field as DATETIME default "2001-01-01", ( e.g. alter table > "notes" add column "last_modified" DATETIME default "2001-01-01";) will > the declared default value be stored as a string or real value? Rael, What you have above is data

Re: [sqlite] DATETIME and storage type

2009-07-27 Thread Rich Shepard
On Mon, 27 Jul 2009, Rael Bauer wrote: > If I declare a field as DATETIME default "2001-01-01", ( e.g. alter table > "notes" add column "last_modified" DATETIME default "2001-01-01";) will > the declared default value be stored as a string or real value? Rael, String (the actual data storage

Re: [sqlite] DATETIME and storage type

2009-07-27 Thread P Kishor
On Mon, Jul 27, 2009 at 4:45 PM, Rael Bauer wrote: > Hi, > > If I declare a field as DATETIME default "2001-01-01", ( e.g. alter table > "notes" add column "last_modified" DATETIME default "2001-01-01";) will the > declared default value be stored as a string or real value?

Re: [sqlite] datetime as integer

2009-03-16 Thread MikeW
John Machin writes: > > > "noon in Greenwich on November 24, 4714 BC" - > > presumably that's the beginning of time for Creationists ... > > You presume incorrectly; it's the start of Scaliger's 7980-year "Julian" > astronomical cycle.

Re: [sqlite] datetime as integer

2009-03-16 Thread John Machin
On 17/03/2009 1:00 AM, MikeW wrote: > Timothy A. Sawyer writes: > [snip] >> For date calculations, SQLite prefers real values containing >> number of days since noon in Greenwich on November 24, 4714 >> B.C., using the Proleptic Gregorian calendar: > SNIP > > "noon in Greenwich on

Re: [sqlite] datetime as integer

2009-03-16 Thread John Elrick
know that baseline value >> --Original Message-- >> From: Kees Nuyt >> Sender: sqlite-users-boun...@... >> To: sqlite-us...@... >> ReplyTo: sqlite-us...@... >> Sent: Mar 13, 2009 14:58 >> Subject: Re: [sqlite] datetime as integer >> >> Just

Re: [sqlite] datetime as integer

2009-03-16 Thread P Kishor
g of time) >> and you must know that baseline value >> --Original Message-- >> From: Kees Nuyt >> Sender: sqlite-users-boun...@... >> To: sqlite-us...@... >> ReplyTo: sqlite-us...@... >> Sent: Mar 13, 2009 14:58 >> Subject: Re: [sqlite] datetime as

Re: [sqlite] datetime as integer

2009-03-16 Thread MikeW
Nuyt > Sender: sqlite-users-boun...@... > To: sqlite-us...@... > ReplyTo: sqlite-us...@... > Sent: Mar 13, 2009 14:58 > Subject: Re: [sqlite] datetime as integer > > Just a few corrections. > SNIP > For date calculations, SQLite prefers real values containing > number o

Re: [sqlite] datetime as integer

2009-03-13 Thread Timothy A. Sawyer
: sqlite-users@sqlite.org Sent: Mar 13, 2009 14:58 Subject: Re: [sqlite] datetime as integer Just a few corrections. On Fri, 13 Mar 2009 13:48:46 +, "Timothy A. Sawyer" <tsaw...@mybowlingdiary.com> wrote: >To be able to do this you need the following data points: > &

Re: [sqlite] datetime as integer

2009-03-13 Thread Fazoogled
-boun...@sqlite.org] On Behalf Of Kees Nuyt Sent: Friday, March 13, 2009 2:58 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] datetime as integer Just a few corrections. On Fri, 13 Mar 2009 13:48:46 +, "Timothy A. Sawyer" <tsaw...@mybowlingdiary.com> wrote: >To be able

Re: [sqlite] datetime as integer

2009-03-13 Thread Simon Davies
2009/3/13 John Machin : > On 12/03/2009 12:21 AM, Nicolás Solá wrote: >> Hi I’m using Trac software and it is implemented using SQLITE3. In Trac DB >> schema there is a table called “milestone”. It has a field called “due” and >> it means due date. The problem is that it uses

Re: [sqlite] datetime as integer

2009-03-13 Thread John Machin
On 12/03/2009 12:21 AM, Nicolás Solá wrote: > Hi I’m using Trac software and it is implemented using SQLITE3. In Trac DB > schema there is a table called “milestone”. It has a field called “due” and > it means due date. The problem is that it uses an integer data type to store > the datum and I

Re: [sqlite] DateTime Objects

2009-03-01 Thread Kees Nuyt
On Sat, 28 Feb 2009 17:30:24 -0800 (PST), jonwood wrote: >Thanks, but I'm not sure what this means. "SQLite date storage format and >support" doesn't appear to be a specific term (at least, it didn't turn up >anything specific on Google). I'm almost sure John Stanton

Re: [sqlite] DateTime Objects

2009-02-28 Thread John Stanton
Look at the Sqlite sourcce code in the date function area and all, is revealed. jonwood wrote: > John Stanton-3 wrote: > >> Use the Sqlite date storage format and support. With that approach >> which is astronomivally correct you can deliver any date format or >> manipulwtion, You may

Re: [sqlite] DateTime Objects

2009-02-28 Thread jonwood
>Storing dates with a two-digit year is... The deja vu, the deja vu! >Why, oh why re-create y2k?! No one's talking about storing them that way. As far as printouts, I'm not overly concerned about this client's reports being ambiguous in the year 2100. Jonathan -- View this message in

Re: [sqlite] DateTime Objects

2009-02-28 Thread Jay A. Kreibich
On Sat, Feb 28, 2009 at 12:28:33PM -0800, jonwood scratched on the wall: > > > Derrell Lipman wrote: > > > > http://sqlite.org/lang_datefunc.html > > > > Exactly. No 2-digit year format, no AM/PM format, and no way to eliminate > leading zeros, etc. Just as I pointed out in my original post.

Re: [sqlite] DateTime Objects

2009-02-28 Thread Nicolas Williams
On Sat, Feb 28, 2009 at 12:47:07PM -0800, jonwood wrote: > > Database is for manipulating data. Your UI application is for presenting > > it nicely to the user. After all, you don't complain that SQLite, say, > > doesn't have functions for formatting numbers in user-friendly manner > > (e.g.

Re: [sqlite] DateTime Objects

2009-02-28 Thread Nicolas Williams
On Sat, Feb 28, 2009 at 06:14:05PM -0800, jonwood wrote: > >So I would just rock it and not worry about it too much. If you're really > >that hard up on saving CPU cycles, they might be better gained elsewhere. > > I just like to be efficient and thought I'd check in to see if I was missing >

Re: [sqlite] DateTime Objects

2009-02-28 Thread jonwood
>You may already be aware of this, but I didn't see it here in the discussion >so I thought I'd chime in. SQLite doesn't really provide a native datetime >type. The data type documentation lays out what's going on in detail (link >below), but I'm pretty certain that your datetime column is

Re: [sqlite] DateTime Objects

2009-02-28 Thread Billy Gray
Hi Jonathon, You may already be aware of this, but I didn't see it here in the discussion so I thought I'd chime in. SQLite doesn't really provide a native datetime type. The data type documentation lays out what's going on in detail (link below), but I'm pretty certain that your datetime column

Re: [sqlite] DateTime Objects

2009-02-28 Thread jonwood
John Stanton-3 wrote: > > Use the Sqlite date storage format and support. With that approach > which is astronomivally correct you can deliver any date format or > manipulwtion, You may need some custom written functions. to get week > number according to national rules etc, but the

Re: [sqlite] DateTime Objects

2009-02-28 Thread John Stanton
Use the Sqlite date storage format and support. With that approach which is astronomivally correct you can deliver any date format or manipulwtion, You may need some custom written functions. to get week number according to national rules etc, but the method is sound. It is also compatible

Re: [sqlite] DateTime Objects

2009-02-28 Thread jonwood
Doug-4 wrote: > > I personally store my times as ints (__time64_t, or time_t). When I read > it > back my app formats it however I want. Simple :) > I think that's the conclusion I'm coming to as well. Thanks. Jonathan -- View this message in context:

Re: [sqlite] DateTime Objects

2009-02-28 Thread jonwood
D. Richard Hipp wrote: > > The date & time come out in an easily parseable format: -MM-DD > HH:MM:SS. So you call: > > sscanf(zDateStr, "%d-%d-%d %d:%d:%d", , , , , , ); > sprintf(zNewDate, "%d/%d/%d %d:%d%s", m, d, y%100, (H-1)%12+1, M, > H>=12 ? "pm" : "am"); > > Is that

Re: [sqlite] DateTime Objects

2009-02-28 Thread Doug
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of jonwood > Sent: Saturday, February 28, 2009 5:17 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] DateTime Objects > > > > Jonas Sandman wrote: > > > > S

Re: [sqlite] DateTime Objects

2009-02-28 Thread D. Richard Hipp
On Feb 28, 2009, at 6:16 PM, jonwood wrote: > > Yeah, I can do parsing with existing column. The date & time come out in an easily parseable format: -MM-DD HH:MM:SS. So you call: sscanf(zDateStr, "%d-%d-%d %d:%d:%d", , , , , , ); sprintf(zNewDate, "%d/%d/%d %d:%d%s", m, d,

Re: [sqlite] DateTime Objects

2009-02-28 Thread Kees Nuyt
On Sat, 28 Feb 2009 12:27:10 -0800 (PST), jonwood wrote: >Derrell Lipman wrote: >> >> http://sqlite.org/lang_datefunc.html >> > >Exactly. No 2-digit year format, no AM/PM format, and no way to eliminate >leading zeros, etc. Just as I pointed out in my original post.

Re: [sqlite] DateTime Objects

2009-02-28 Thread Jonas
So store your time as a 64-bit integer. Sqlite has support for that. On 28 feb 2009, at 21.47, jonwood wrote: > >> Database is for manipulating data. Your UI application is for >> presenting >> it nicely to the user. After all, you don't complain that SQLite, >>

Re: [sqlite] DateTime Objects

2009-02-28 Thread Igor Tandetnik
"jonwood" wrote in message news:22264879.p...@talk.nabble.com > I have a SQLite table that contains a DATETIME value. However, the > database does not appear to provide enough control over how that > value is formatted. For example, I'd like a two-digit year, to >

Re: [sqlite] DateTime Objects

2009-02-28 Thread jonwood
Derrell Lipman wrote: > > http://sqlite.org/lang_datefunc.html > Exactly. No 2-digit year format, no AM/PM format, and no way to eliminate leading zeros, etc. Just as I pointed out in my original post. Jonathan -- View this message in context:

Re: [sqlite] DateTime Objects

2009-02-28 Thread Derrell Lipman
On Sat, Feb 28, 2009 at 1:47 PM, jonwood wrote: > > Greetings, > > I have a SQLite table that contains a DATETIME value. However, the database > does not appear to provide enough control over how that value is formatted. > For example, I'd like a two-digit year, to

Re: [sqlite] Datetime issue with the time part

2008-07-15 Thread Sebastien Robillard
Eric Minbiole wrote: > From what you describe, it seems that the compiler is performing > single-precision, rather than double-precision, math. After a quick > Google search, I found a few posts indicating that Direct3D silently > switches the FPU from double to single precision math,

Re: [sqlite] Datetime issue with the time part

2008-07-14 Thread Eric Minbiole
> Once again, all of these problems doesn't happen before the creation of > the Direct3D device. Does anyone ever used SQLite successfully in a > full-screen 3D game ? From what you describe, it seems that the compiler is performing single-precision, rather than double-precision, math. After

Re: [sqlite] Datetime issue with the time part

2008-07-14 Thread Sebastien Robillard
Eric Minbiole wrote: > Sebastien Robillard wrote: > >> Hi everyone, >> I have an issue with datetimes that doesn't return the "time" part >> correctly (always 00:00:00 or 18:00:00) when I use SQLite in my C++ >> code. Whenever I use datetime('now'), or current_timestamp, the time is >>

Re: [sqlite] Datetime issue with the time part

2008-07-14 Thread Eric Minbiole
Sebastien Robillard wrote: > Hi everyone, > I have an issue with datetimes that doesn't return the "time" part > correctly (always 00:00:00 or 18:00:00) when I use SQLite in my C++ > code. Whenever I use datetime('now'), or current_timestamp, the time is > not correct. However, it works

Re: [sqlite] datetime bug

2008-06-12 Thread P Kishor
On 6/12/08, Shane Harrelson <[EMAIL PROTECTED]> wrote: > I was able to reproduce this by setting by TZ to GMT +10:00. It's a > floating point rounding issue in the julian date functions. We're > investigating how to best correct it, but I don't have a "fix" for you now. I can reproduce this

Re: [sqlite] datetime bug

2008-06-12 Thread Shane Harrelson
I was able to reproduce this by setting by TZ to GMT +10:00. It's a floating point rounding issue in the julian date functions. We're investigating how to best correct it, but I don't have a "fix" for you now. On 6/12/08, BareFeet <[EMAIL PROTECTED]> wrote: > > Hi Shane, > > >> This:

Re: [sqlite] datetime bug

2008-06-12 Thread Dennis Cote
BareFeet wrote: > > I get the same result above when using the command line tool of the > built in SQLite version 3.4.0 or the latest binary version 3.5.9. > > FYI, this: select julianday('2008-06-12','utc'); > gives: 2454629.0833 > > and this: select datetime(2454629.0833,

Re: [sqlite] datetime bug

2008-06-11 Thread BareFeet
Hi Shane, >> This: select datetime(julianday('2008-06-12','utc'), >> 'localtime'); >> >> should give this: 2008-06-12 00:00:00 >> >> but instead gives: 2008-06-11 24:00:00 > Can you provide some details of your test setup? What version of > SQLite? > What platform (compiler,

Re: [sqlite] datetime bug

2008-06-11 Thread Shane Harrelson
Tom- Can you provide some details of your test setup? What version of SQLite? What platform (compiler, O/S, processor, 32bit vs 64bit, etc.)? I updated the date testscripts in CVS to add tests for you cases below, and they worked correctly for version 3.5.9 of SQLite compiled with both GCC and

Re: [sqlite] DATETIME data type

2008-02-28 Thread Trey Mack
Store it in '-mm-dd' format, or use the julian date that's suggested at: http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions Yong Zhao wrote: > It seems that sqlite3 does not support DATETIME data type. > > If I have the following data in table t1, how do I select people who is > older

Re: [sqlite] DATETIME data type

2008-02-28 Thread Igor Tandetnik
"Yong Zhao" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It seems that sqlite3 does not support DATETIME data type. > > If I have the following data in table t1, how do I select people who > is older than certain date? > > create table t1(dob text, name text); > insert into

Re: [sqlite] DATETIME data type

2008-02-28 Thread Neville Franks
Friday, February 29, 2008, 8:29:16 AM, you wrote: YZ> It seems that sqlite3 does not support DATETIME data type. YZ> If I have the following data in table t1, how do I select people who is YZ> older than certain date? YZ> create table t1(dob text, name text); YZ> insert into t1('11/12/1930',

Re: [sqlite] DATETIME data type

2008-02-28 Thread John Stanton
Try using the Sqlite date functions. Yong Zhao wrote: > It seems that sqlite3 does not support DATETIME data type. > > If I have the following data in table t1, how do I select people who is > older than certain date? > > create table t1(dob text, name text); > insert into t1('11/12/1930',

Re: [sqlite] DATETIME data type

2008-02-28 Thread Steven Fisher
On 28-Feb-2008, at 1:29 PM, Yong Zhao wrote: > It seems that sqlite3 does not support DATETIME data type. > > If I have the following data in table t1, how do I select people who > is > older than certain date? Use -MM-DD instead of M/D/Y. Available formats described here under Time

Re: [sqlite] datetime column type, how-to

2005-02-15 Thread Dmitry Bobrik
Hello Uriel, Tuesday, February 15, 2005, 2:19:07 AM, you wrote: Unc> SQLiters: Unc> What would be the best method for creating a Table with one column in the Unc> format 03-Mar-2005 16:05:30? Unc> i.e. dd-mmm-yy hh:mm:ss You should store the datetime in SQL-Timestamp format, in case you need a

Re: [sqlite] datetime column type, how-to

2005-02-14 Thread Jeff Thompson
[EMAIL PROTECTED] wrote: SQLiters: What would be the best method for creating a Table with one column in the format 03-Mar-2005 16:05:30? i.e. dd-mmm-yy hh:mm:ss I would store the date in UNIX timestamp format. I will need to retrieve by date/time in proper order. i.e. "select * from 'table'

Re: [sqlite] datetime modifier for localtime

2004-01-16 Thread Derrell . Lipman
Kurt Welgehausen <[EMAIL PROTECTED]> writes: > If I remember right, localtime and gmtime were not implemented > in 2.8.8. You need to upgrade. Ah! Well that would certainly explain it. Thanks! Derrell - To unsubscribe,