I am trying to set a server agnostic date time in my database and I believe the best practice to do so is to set a UTC DateTime. My db server is Cassandra and the db driver
For a docker application like beehuang commented you should set your timezone.
Alternatively you can use withZoneSameLocal. For example:
2014-07-01T00:00+02:00[GMT+02:00] is converted by
Date.from(zonedDateTime.withZoneSameLocal(ZoneId.systemDefault()).toInstant())
to Tue Jul 01 00:00:00 CEST 2014 and by
Date.from(zonedDateTime.toInstant())
to Mon Jun 30 22:00:00 UTC 2014