简体   繁体   中英

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).

user.timezone Java system property might help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM