DateTimeToHtml5LocalDateTimeTransformer
class DateTimeToHtml5LocalDateTimeTransformer extends BaseDateTimeTransformer
Constants
HTML5_FORMAT |
|
Properties
static protected | $formats | from BaseDateTimeTransformer | |
protected | $inputTimezone | from BaseDateTimeTransformer | |
protected | $outputTimezone | from BaseDateTimeTransformer |
Methods
No description
Transforms a \DateTime into a local date and time string.
Transforms a local date and time string into a \DateTime.
Details
mixed
transform(DateTime|DateTimeInterface $dateTime)
Transforms a \DateTime into a local date and time string.
According to the HTML standard, the input string of a datetime-local input is a RFC3339 date followed by 'T', followed by a RFC3339 time. https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-local-date-and-time-string
mixed
reverseTransform(string $dateTimeLocal)
Transforms a local date and time string into a \DateTime.
When transforming back to DateTime the regex is slightly laxer, taking into account rules for parsing a local date and time string https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#parse-a-local-date-and-time-string