如何在不更改 JVM 默认时区的情况下管理 spring 批处理框架表 (BATCH_*) 的时区
How to manage the timezone for spring batch framework tables (BATCH_*) without changing the JVM default timezone
我要求我的 Spring 批处理 table 条目,如 BATCH_JOB_EXECUTION、BATCH_STEP_EXECUTION 等,使时间戳条目(create_time、start_time,end_time 等)使用 GMT 时区,但我的批处理 jvm 使用不同的时区 (-Duser.timezone=CET) 运行。由于 Spring 目前使用 java.util.Date 获取这些时间戳,我看不到任何其他选项来处理这个问题而不触及
-Duser.timezone。如果我们目前有任何其他选项可用于处理此要求或 Spring 批量引入 java.util.time* 类(时区感知)以在将来处理时间戳的机会,请告诉我。
感谢和问候,
巴鲁R
最新的 Spring Batch v4.2.2(在撰写本文时)无法做到这一点。这里有一个未解决的问题:https://github.com/spring-projects/spring-batch/issues/1014
我要求我的 Spring 批处理 table 条目,如 BATCH_JOB_EXECUTION、BATCH_STEP_EXECUTION 等,使时间戳条目(create_time、start_time,end_time 等)使用 GMT 时区,但我的批处理 jvm 使用不同的时区 (-Duser.timezone=CET) 运行。由于 Spring 目前使用 java.util.Date 获取这些时间戳,我看不到任何其他选项来处理这个问题而不触及 -Duser.timezone。如果我们目前有任何其他选项可用于处理此要求或 Spring 批量引入 java.util.time* 类(时区感知)以在将来处理时间戳的机会,请告诉我。
感谢和问候,
巴鲁R
最新的 Spring Batch v4.2.2(在撰写本文时)无法做到这一点。这里有一个未解决的问题:https://github.com/spring-projects/spring-batch/issues/1014