简体   繁体   English

Spring 调度程序任务运行多个时区 dateTime

[英]Spring Scheduler task run with multiple timezones dateTime

I have multiple timeZone customers wise and Application works with UTC.So, Normally I implemented我有多个 timeZone 客户,应用程序与 UTC 一起工作。所以,通常我实施

@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;但问题是它在 UTC 时间上午 12:10 运行; 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. UTC 00:10 AM 在 IST 是 5:40 AM,因此印度的客户将在 05:40 AM 而不是 IST 的 00:10 AM 收到通知。

Require: I need to run a task(scheduler) at 00:10 AM in each customer time zone Not in Application TimeZone(UTC).要求:我需要在每个客户时区的上午 00:10 运行一个任务(调度程序),而不是在应用程序时区(UTC)中。

user.timezone Java system property might help user.timezone Java 系统属性可能有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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