title: Handling Daylight Saving Time with OffsetDateTime in Java when time needs to remain the same in local time regardless of DST
body: <p>I'm using Spring Boot (Java 8) to develop the backend for a restaurant app which exposes some REST APIs. Everything related to dates and times is handled with <code>OffsetDateTime</code> objects and through the app I use, by default, the offset of <code>&quot;Europe/Rome&quot;</code>. Those objects are also persisted in the DB. Everything is working fine, except... daylight saving time kicked in and now all the business hours of the restaurant are off by one hour.</p>
  <p>This obviously happens because pre-DST the offset of <code>&quot;Europe/Rome&quot;</code> is <code>+01:00</code>, while post-DST is <code>+02:00</code>. So, to give you an example, the opening hour of the restaurant (saved inside the DB pre-DST) is <code>08:30:00+01:00</code>, but it becomes <code>09:30:00+02:00</code> when accessed post-DST from the API (because it's automatically converted with the default zone of the system). I need the business hours of the restaurant to remain the same in local time, regardless of DST.</p>
  <p>How can I handle this situation and offer consistent data to my users?</p>