On Tue, Sep 10, 2019 at 1:05 PM Keith Medcalf <kmedc...@dessus.com> wrote:

> insert into test values ('00:00:07.86');
> select value,
>        round((julianday(value) - julianday('00:00:00')) * 86400.0, 3)
>   from test;
>

Thanks! As I guessed, I was indeed missing something.
But IMHO that something is definitely not obvious or straightforward though.

I still think a strptime()-like function to parse according to a format a
text date/time would be much more obvious.
With modifiers specifying the output units, no need to subtract and
multiply. But that's just me I guess.

You are limited to "value" between 00:00:00.000 and 23:59:59.999 since the
> internal datetime only stores julian milliseconds.  Note that the default
> date if you do not provide that part is 2000-01-01
>

Indeed, this works here, but if you have a duration with a number of hours
that exceeds 24h, or one measured in MMMMM:SS:FF (F for fractional seconds)
where MMMMM exceeds 60min, etc...
what do you do them? Back to extracting components via text manipulations
and doing your own math?
Seems to me one needs to be a super expert like you Keith to do these
things, when it ought to be simpler, no? --DD
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to