Do you plan to address the use cases in the SO post, or asked differently - what is the intended use case of this library?
I tried to recreate it on your site (which is very cool btw in allowing the code to run in browser) and it seems to fail and give the wrong time difference.
select time_compare(time_date(1927, 12, 31, 23, 58, 08, 0, 28800000), time_date(1927, 12, 31, 23, 58, 09, 0, 28800000));
Results in an answer of '1', which is incorrect.Please don't take my comments as being negative or unappreciated, this is super difficult stuff and anyone who tries to make the world an easier place should be thanked for that. So thank you.
----
EDIT: this post explains why the answer isn't "1"
https://stackoverflow.com/questions/6841333/why-is-subtracti...
This query returns -1 (minus one, not one), which seems correct to me. The first date is before the second:
select time_compare(
time_date(1927, 12, 31, 23, 58, 08, 0, 28800000),
time_date(1927, 12, 31, 23, 58, 09, 0, 28800000)
);
-1Deleted Comment
I do think the documentation could be a little clearer. The author talks about “time zones” but the library only deals with time zone offsets. (A time zone is something like America/New_York, while a time zone offset is the difference to UTC time, which is -14400 seconds for New York today, but will be -18000 in a few months due to daylight saving time changes.)
select time_to_nano(time_now());
-- 1722979335431295000Dead Comment
I wonder what does
select time_sub(time_date(2011, 11, 19), time_date(1311, 11, 18));
return?