@Override protected String doForward(ZoneId zoneId) { if (zoneId == null) return null; return zoneId.normalized().getId(); }
@Override protected String doForward(ZoneId zoneId) { if (zoneId == null) return null; return zoneId.normalized().getId(); }
@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); } }
@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); } }
case "HK": case "US": final ZonedDateTime zdtUS = lastUpdate.atZone(ZoneId.of("UTC").normalized()); if (zdtUS.getHour() >= 21 && zdtUS.getMinute() > 25) { // 4:25 EST for delayed online sources result = false; final ZonedDateTime zdtUK = lastUpdate.atZone(ZoneId.of("UTC").normalized()); if (zdtUK.getHour() >= 21 && zdtUK.getMinute() > 55) { // 4:55 EST for delayed online sources result = false; final ZonedDateTime zdtIN = lastUpdate.atZone(ZoneId.of("UTC").normalized()); if (zdtIN.getHour() >= 20 && zdtIN.getMinute() > 55) { // 3:55 EST for delayed online sources result = false;
@Override public boolean print(DateTimePrintContext context, StringBuilder buf) { ZoneId zone = context.getValue(TemporalQueries.zoneId()); if (zone == null) { return false; } if (zone.normalized() instanceof ZoneOffset) { buf.append(zone.getId()); return true; } Long epochSec = context.getTemporal().getLong(INSTANT_SECONDS); Instant instant; if (epochSec != null) { instant = Instant.ofEpochSecond(epochSec); } else { instant = Instant.ofEpochSecond(-200L * 365 * 86400); // about 1770 } TimeZone tz = TimeZone.getTimeZone(zone.getId()); boolean daylight = zone.getRules().isDaylightSavings(instant); int tzstyle = (textStyle.asNormal() == TextStyle.FULL ? TimeZone.LONG : TimeZone.SHORT); String text = tz.getDisplayName(daylight, tzstyle, context.getLocale()); buf.append(text); return true; }
ZoneId zoneId = timeZone.toZoneId().normalized(); if (zoneId instanceof ZoneOffset) { ZoneOffset zoneOffset = (ZoneOffset) zoneId;
ZoneId zoneId = timeZone.toZoneId().normalized(); if (zoneId instanceof ZoneOffset) { ZoneOffset zoneOffset = (ZoneOffset) zoneId;
ZoneId zoneId = timeZone.toZoneId().normalized(); if (zoneId instanceof ZoneOffset) { ZoneOffset zoneOffset = (ZoneOffset) zoneId;
ZoneId zoneId = timeZone.toZoneId().normalized(); if (zoneId instanceof ZoneOffset) { ZoneOffset zoneOffset = (ZoneOffset) zoneId;
{ "date and time(\"2016-07-29T05:48:23\")", LocalDateTime.of( 2016, 7, 29, 5, 48, 23, 0 ) , null}, { "date and time( 2016, 7, 29, 5, 48, 23 )", LocalDateTime.of( 2016, 7, 29, 5, 48, 23, 0 ) , null}, { "date and time(\"2016-07-29T05:48:23Z\")", ZonedDateTime.of(2016, 7, 29, 5, 48, 23, 0, ZoneId.of("Z").normalized()) , null}, { "date and time( 2016, 7, 29, 5, 48, 23, -5 )", OffsetDateTime.of(2016, 7, 29, 5, 48, 23, 0, ZoneOffset.ofHours( -5 ) ) , null}, { "date and time(\"2016-07-29T05:48:23.765-05:00\")", DateTimeFormatter.ISO_DATE_TIME.parse( "2016-07-29T05:48:23.765-05:00", ZonedDateTime::from ) , null}, { "date and time(\"2016-07-29T05:48:23Z\") + duration( \"P1Y1M\" )", ZonedDateTime.of(2017, 8, 29, 5, 48, 23, 0, ZoneId.of("Z").normalized()) , null}, { "date and time(\"2016-07-29T05:48:23\") + duration( \"P1Y1M\" )", LocalDateTime.of(2017, 8, 29, 5, 48, 23, 0) , null}, { "date and time(\"2016-07-29T05:48:23Z\") + duration( \"P1DT1H1M\" )", ZonedDateTime.of(2016, 7, 30, 6, 49, 23, 0, ZoneId.of("Z").normalized()) , null}, { "date and time(\"2016-07-29T05:48:23\") + duration( \"P1DT1H1M\" )", LocalDateTime.of(2016, 7, 30, 6, 49, 23, 0) , null}, { "date(\"2016-07-29\") + duration( \"P3D\" )", LocalDate.of(2016, 8, 1) , null}, { "duration( \"P3D\" ) + date(\"2016-07-29\")", LocalDate.of(2016, 8, 1) , null}, { "duration( \"P1Y1M\" ) + date(\"2016-07-29\")", LocalDate.of(2017, 8, 29) , null}, { "duration( \"P1Y1M\" ) + date and time(\"2016-07-29T05:48:23Z\")", ZonedDateTime.of(2017, 8, 29, 5, 48, 23, 0, ZoneId.of("Z").normalized()) , null}, { "duration( \"P1Y1M\" ) + date and time(\"2016-07-29T05:48:23\")", LocalDateTime.of(2017, 8, 29, 5, 48, 23, 0) , null}, { "duration( \"P1DT1H1M\" ) + date and time(\"2016-07-29T05:48:23Z\")", ZonedDateTime.of(2016, 7, 30, 6, 49, 23, 0, ZoneId.of("Z").normalized()) , null}, { "duration( \"P1DT1H1M\" ) + date and time(\"2016-07-29T05:48:23\")", LocalDateTime.of(2016, 7, 30, 6, 49, 23, 0) , null}, { "time(\"22:57:00\") + duration( \"PT1H1M\" )", LocalTime.of(23, 58, 0) , null}, { "date and time(\"2016-07-29T05:48:23Z\") - duration( \"P1Y1M\" )", ZonedDateTime.of(2015, 6, 29, 5, 48, 23, 0, ZoneId.of("Z").normalized()) , null}, { "date and time(\"2016-07-29T05:48:23\") - duration( \"P1Y1M\" )", LocalDateTime.of(2015, 6, 29, 5, 48, 23, 0) , null}, { "date and time(\"2016-07-29T05:48:23Z\") - duration( \"P1DT1H1M\" )", ZonedDateTime.of(2016, 7, 28, 4, 47, 23, 0, ZoneId.of("Z").normalized()) , null}, { "date and time(\"2016-07-29T05:48:23\") - duration( \"P1DT1H1M\" )", LocalDateTime.of(2016, 7, 28, 4, 47, 23, 0) , null}, { "date(\"2016-07-29\") - duration( \"P1D\" )", LocalDate.of(2016, 7, 28) , null},
ZoneId normalizedOffset = overrideZone.normalized(); ZoneOffset temporalOffset = temporal.query(TemporalQueries.offset()); if (normalizedOffset instanceof ZoneOffset && temporalOffset != null && normalizedOffset.equals(temporalOffset) == false) {