Why have Timestamp hour as largest unit for addition/subtraction? #124
-
I have a tool for managing some docker images, perfect for playing and getting familiar with new libraries like jiff. So, I wanted to list all images newer than 7 days. So I did So, what is the rationale behind having a Hour unit limit for Timestamp? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Good question. This has a few knots to it, and I suspect one implied aspect of your question is "why doesn't So first, the
( So from that alone, I think the suggestion here would be that you ought to be using Now, the reason why Because of that, all of the
Now, as #48 discusses, this is perhaps not ideal. Temporal might have a different set of trade-offs to consider here. In particular, they are sticking with a single duration type. But in Jiff, I've already added a second duration type called Popping up a level, here is what my advice would be at this point:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply, even if it doesn't really matter in my case (no biggie if things get an hour or two off), I will probably still switch to zoned just for correctness. Trying to figure out some trick to get this to fail at compile time, that wouldn't mess up the API... but I guess that is not very easy... |
Beta Was this translation helpful? Give feedback.
Good question. This has a few knots to it, and I suspect one implied aspect of your question is "why doesn't
Timestamp
support days, but I can round aSpan
in a way that assumes all days are 24 hours?"So first, the
Timestamp
restriction to units of hours or smaller comes from Temporal: