Force Java timezone as GMT/UTC
问题 I need to force any time related operations to GMT/UTC, regardless the timezone set on the machine. Any convenient way to so in code? To clarify, I\'m using the DB server time for all operations, but it comes out formatted according to local timezone. Thanks! 回答1: The OP answered this question to change the default timezone for a single instance of a running JVM, set the user.timezone system property: java -Duser.timezone=GMT ... <main-class> If you need to set specific time zones when