Ronak Patel
Ronak Patel

Reputation: 33

Spring Scheduler task run with multiple timezones dateTime

I have multiple timeZone customers wise and Application works with UTC.So, Normally I implemented

@Scheduled(cron = "0 10 0 * * ?") // This scheduler will run at 00:10 AM daily And Send Notification.

But the problem is it runs on UTC time 12:10 AM; However, it may differ based on customer TimeZone

eg. UTC 00:10 AM In IST it's 5:40 AM so India's customer will get a notification at 05:40 AM instead of 00:10 AM in IST.

Require: I need to run a task(scheduler) at 00:10 AM in each customer time zone Not in Application TimeZone(UTC).

Upvotes: 1

Views: 1111

Answers (1)

SOUMEN K
SOUMEN K

Reputation: 468

user.timezone Java system property might help

Upvotes: 1

Related Questions