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

Add time zone support #36

Open
felixbarny opened this issue Sep 27, 2019 · 8 comments
Open

Add time zone support #36

felixbarny opened this issue Sep 27, 2019 · 8 comments

Comments

@felixbarny
Copy link
Member

Use the JVM's default timezone by default and let users configure a different time zone.

@zcranberry
Copy link

hope can use timezone soon.

@felixbarny
Copy link
Member Author

Would you be interested to implement this feature?

@felixbarny felixbarny added the good first issue Good for newcomers label Aug 26, 2020
@keremh
Copy link

keremh commented Dec 8, 2020

hi, can i work on this issue?

@felixbarny
Copy link
Member Author

You can but in contrast to what the labels say, it's probably not a good first issue. I've tried it the other day and it's more tricky than I have though.

The reason is the requirement of not allocating objects during serialization to reduce GC pressure on the application. It means that we can't just use SimpleDataFormat or any date format that comes with the JDK. I've implemented TimestampSerializer but adding time zone support for it is quite hard. The class works under the premise that It only has to invoke SimpleDataFormat for to format the year, month and date. The result can be cached until the next day. The hour:minute:second.microsecond part of the timestamp is efficiently computed with modulo operations.

The issue is that the UTC offset can change during a day (on the day daylight savings time changes). Thus, we can't cache the UTC offset.

I don't have a good idea about how to proceed. Maybe we could use an adapted version of https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/time/FastDateFormat.html that accepts StringBuilder instead of StringBuffer. But I have not compared the performance to the current TimestampSerializer yet. So I guess that would be the first step.

@keremh
Copy link

keremh commented Dec 8, 2020

Thanks for your suggestion and explanations, so i look for another issue.

@felixbarny felixbarny removed the good first issue Good for newcomers label Dec 9, 2020
@Rocky-Hu
Copy link

Rocky-Hu commented Feb 5, 2024

hello, how to resolve it?

@Rocky-Hu
Copy link

Rocky-Hu commented Feb 5, 2024

@felixbarny

@jackshirazi
Copy link
Contributor

As outlined, this is significant work, so not currently priortized

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

No branches or pull requests

6 participants