Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在一个使用JCalendar的遗留应用程序上工作。是否可以在不同的时区操作 JCalendar?这个包的内部似乎假定了本地时区。我们的应用程序假定为 GMT,因此我们希望日期和时间由com.toedter.calendar.JTextFieldDateEditor和com.toedter.calendar.JSpinnerDateEditor类在 GMT 中处理和呈现。
com.toedter.calendar.JTextFieldDateEditor
com.toedter.calendar.JSpinnerDateEditor
为方便起见,您可以TimeZone在程序的早期设置默认值。
TimeZone
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));