Skip to content
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

Using JVM time zone rules in Joda #491

Open
haozhun opened this issue Nov 10, 2018 · 2 comments
Open

Using JVM time zone rules in Joda #491

haozhun opened this issue Nov 10, 2018 · 2 comments

Comments

@haozhun
Copy link

haozhun commented Nov 10, 2018

I understand that this is not something that Joda can provide because Joda cannot depend on java.time. I'm writing this issue for two reasons:

  1. I would like comments from @jodastephen about the implementation, both from correctness and performance perspective.
  2. I understand that I'm not the first one that has wanted to do this. But I can't find any one who did this successfully. I would like my code be available to others.

https://gist.github.com/haozhun/f73e0c73a2dcc816c752d101b3513ce1

I understand that this is something more suitable for something like a mailing list than an issue. However, the only I can find is from SourceForge, which is likely obsolete.

@haozhun
Copy link
Author

haozhun commented Dec 20, 2018

I made some changes to the code I originally posted here. The only significant change is that all zones are initiated ahead of time (instead of using a cache). For my use case, the simplicity is worth it over the performance.

Updated code is here: https://github.com/airlift/joda-to-java-time-bridge

Your comment would be greatly appreciated.

@jodastephen
Copy link
Member

This looks pretty good to me. In an ideal world, it would be nice to have a Java 8 version of Joda-Time that aids the transition to java.time.*, but it isn't easy to find the time.

I'll leave this open to aid others in finding the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants