Skip to content

Commit

Permalink
fix timezone serialization for joda bwc
Browse files Browse the repository at this point in the history
  • Loading branch information
rjernst committed Sep 14, 2018
1 parent eab341a commit f105096
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,8 @@ public final <K, V> void writeMap(final Map<K, V> map, final Writer<K> keyWriter
o.writeByte((byte) 13);
final JodaCompatibleZonedDateTime zonedDateTime = (JodaCompatibleZonedDateTime) v;
String zoneId = zonedDateTime.getZonedDateTime().getZone().getId();
o.writeString(DateTimeZone.UTC.getID());
// joda does not understand "Z" for utc, so we must special case
o.writeString(zoneId.equals("Z") ? DateTimeZone.UTC.getID() : zoneId);
o.writeLong(zonedDateTime.toInstant().toEpochMilli());
});
WRITERS = Collections.unmodifiableMap(writers);
Expand Down

0 comments on commit f105096

Please sign in to comment.