title: How to change the timezone offset in Java for a Date object?
body: <p>I have a Date object that is getting the date from the database which is already in UTC, but the timezone offset gets converted based on the location where the application is running.</p>
  
  <p>So if the database has date: <code>2019-09-06 00:00:00.000</code> and the application is running in LA, the Date object will have the offset of 7 and the output will look like this <code>2019-09-06T07:00Z</code>. Since the date is already in UTC, I want it to look like <code>2019-09-06T00:00Z</code> no matter where it is being run.</p>
  
  <p>The Date class does not have a <code>setTimeZone()</code> method and the first thing that came to mind is to convert it to a String and hardcode <code>00:00Z</code> at the end, which isn't clean. Any ideas?</p>
  
  <p>More info: The column has a type of DATETIME. DB: SQL Server.</p>