class GeneralizedTimeValueTranscoder extends AbstractStringValueTranscoder<ZonedDateTime> {

  @Override
  public String encodeStringValue(final ZonedDateTime value)
  {
    if (value.getZone().normalized().equals(ZoneOffset.UTC)) {
      return value.format(DATE_FORMAT);
    } else {
      return value.withZoneSameInstant(ZoneOffset.UTC).format(DATE_FORMAT);
    }
  }

}