On Fri, Jan 2, 2015 at 4:44 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 3 Jan 2015, at 12:12am, J Decker <d3c...@gmail.com> wrote:
>
> > https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct
> type
> > */
>
> No it doesn't.  It says that if you try to define a column as DATETIME
> SQLite will understand it as you wanting a column with NUMERIC affinity.
>
> I know... but that first implies that it will work as a number, esp. if
the content is a understood datetime format... which I was quite happy
with, decided that maybe local-prefixed self-descriptive offset times could
be nice... (not sure how -3:15 is handled... is that -3 + 45?... but that's
well out of scope)

... so it's default is to use a string format... the type of the column is
kept in sqlite_master; ie, my program learns what the column type is
itself... so... I dunno... I added a few functions and now have a >,<,=
tester and nots of those... and it's a tiny amount of code... that
datetime() has already


>
> To do what you want use the datetime function "strftime('%s',value)" to
> convert your stored time values into seconds since 1970.  This will let you
> use the operators you have listed above.  Here's an example:
>
> strftime('%s',receivedate) < strftime('%s',receivedate2)
>

okay I wrote invalid times. I thought the colon was optional in the
timezone offset portion
Yup Totally my bad; sorry all. thanx though.


> This use will recognise all the string formats you've listed above.
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to