-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 quarkus.timezone
to make time zone selection deterministic
#43578
Comments
If the proposed solution in #43577 works, you only need to set |
#43577 was the catalyst for this suggestion, but the idea stands alone. When you do need to guarantee a timezone, there is seemingly no way (at least no way I found) to set the timezone and have it run in all configurations (dev, test, continuous-test, prod). Actually, I'm going to guess there is a way, but it definitely involves a lot of "figuring it out" and, from what I can tell, setting the timezone in multiple places -- a couple in That isn't a nice developer experience, and it should be fixed. Additionally, whatever the solution is, there's no simple documentation of it (that I've found). |
@kdubb I completely agree that the current experience is very subpar, and I am assuming we could tackle it without too much trouble. |
When running as a container, I set an environment variable |
Description
You can read about my catalyzing issue at #43577.
Additionally, numerous similar issues have been filed over the years.
Also, when you have figured out the issue with initialization and still want to set the time zone, you need to track down where that should happen; spoiler... it's at least two or three places to make sure the time zone is set during Dev, Test, Continuous Testing**, and Prod.
It's worth noting that Continuous Testing and
quarkus test
were where the real problems arose; I believe this is due to forking for tests, but I'm not sure.Currently, this simple task can produce hours of spelunking and debugging to get done. It feels like a nightmare.
Finally, our issues did arise from a bug, but it's worth noting that there's no workaround. We abandoned using
@CreationTimestamp
and@UpdateTimestamp
altogether because we couldn't get the clock set in certain modes.Implementation ideas
Add a
quarkus.timezone
property that, when set, directs Quarkus to set the Clock prior to STATIC_INIT.This would allow developers to have a simple property to set and know that in all configurations, the time zone will be what they require, is appropriately set, and is at the right time.
Additionally, given that Quarkus has a very dynamic configuration system... setting
%test.quarkus.timezone=UTC
would give you a simple method to enable it only for tests and continuous testing.The text was updated successfully, but these errors were encountered: