-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use jiff for timestamp #40
Conversation
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
@BurntSushi FYI this is what I'm trying to replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jiff uses API design to try to prevent you from making mistakes. For a Timestamp
, the meaning of "day" is ambiguous. It might be reasonable to assume it's always 24 hours, but it might not. So Jiff forces you to make an explicit choice. You could switch to Zoned
in the UTC
time zone. Or you could just add 24.hours()
to a Timestamp
for each day if you want to make that assumption explicitly.
Signed-off-by: tison <[email protected]>
@BurntSushi Thanks for all your help! Final question: Currently, I use The question is, I don't know if jiff's default pattern, i.e., |
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
Signed-off-by: tison <[email protected]>
This is fine for fixing the precision for now until
Yes, as documented, it follows RFC 9557. This is documented in lots of places:
RFC 9557 doesn't yet have broad support, but it's supported by |
Signed-off-by: tison <[email protected]>
@BurntSushi Thanks for your detailed explaination! I'll keep the current strftime impl for now.
Yes. Although Once RFC 9557 becomes more famous, I would reconsider this format. And it's always possible we add it an option in #7. Looking forward to jiff 1.0 and I'll sooner release a logforth 0.9 for the first jiff integrated version :D |
Sweet thank you! |
This closes #35.
@1996fanrui if you'd like to implement something more flexible like Logback's and Log4j's PatternLayout, you can try to follow #7.