public function format(DateTimePrintContext $context, &$buf) { /** @var ZoneID $zone */ $zone = $context->getValue($this->query); if ($zone === null) { return false; } $buf .= $zone->getId(); return true; }
public function format(DateTimePrintContext $context, &$buf) { $chrono = $context->getValue(TemporalQueries::chronology()); if ($chrono == null) { return false; } if ($this->textStyle == null) { $buf .= $chrono->getId(); } else { $buf .= $this->getChronologyName($chrono, $context->getLocale()); } return true; }
public function format(DateTimePrintContext $context, &$buf) { /** @var ZoneID $zone */ $zone = $context->getValue(TemporalQueries::zoneId()); if ($zone === null) { return false; } $zname = $zone->getId(); if (!$zone instanceof ZoneOffset) { $dt = $context->getTemporal(); $name = $this->getDisplayName($zname, $dt->isSupported(ChronoField::INSTANT_SECONDS()) ? $zone->getRules()->isDaylightSavings(Instant::from($dt)) ? self::$DST : self::$STD : self::$GENERIC, $context->getLocale()); if ($name !== null) { $zname = $name; } } $buf .= $zname; return true; }