How can I configure the time zone for a Spring based @Scheduled cron job?
Background:
I have a job that executes once a day, say 2 PM, usin
Your code should be like this:
@Scheduled(cron = "0 0 14 * * *", zone = "GMT-5") public void execute() { // do scheduled job }
"Zone" is gonna be the desired country's timezone.
Here is a nice tutorial about scheduled tasks with Spring:
https://www.baeldung.com/cron-expressions