Lines Matching refs:format
41 foreach (['json', 'xml'] as $format) {
46 'format' => $format,
53 'format' => $format,
80 return $visitor->visitSimpleString($date->format($this->getFormat($type)), $type);
83 $format = $this->getFormat($type);
84 if ('U' === $format) {
85 return $visitor->visitInteger((int) $date->format($format), $type);
88 return $visitor->visitString($date->format($this->getFormat($type)), $type);
122 $iso8601DateIntervalString = $this->format($date);
225 $format = $this->getDeserializationFormat($type);
228 $datetime = \DateTimeImmutable::createFromFormat($format, (string) $data, $timezone);
230 $datetime = \DateTime::createFromFormat($format, (string) $data, $timezone);
234 … throw new RuntimeException(sprintf('Invalid datetime "%s", expected format %s.', $data, $format));
237 if ('U' === $format) {
278 public function format(\DateInterval $dateInterval): string function in JMS\\Serializer\\Handler\\DateHandler
280 $format = 'P';
283 $format .= $dateInterval->y . 'Y';
287 $format .= $dateInterval->m . 'M';
291 $format .= $dateInterval->d . 'D';
295 $format .= 'T';
299 $format .= $dateInterval->h . 'H';
303 $format .= $dateInterval->i . 'M';
307 $format .= $dateInterval->s . 'S';
310 if ('P' === $format) {
311 $format = 'P0DT0S';
314 return $format;