DateTimeToHtml5LocalDateTimeTransformer
class DateTimeToHtml5LocalDateTimeTransformer extends BaseDateTimeTransformer
Constants
Properties
Methods
Details
__construct(string $inputTimezone = null, string $outputTimezone = null)
Parameters
string | $inputTimezone | The name of the input timezone |
string | $outputTimezone | The name of the output timezone |
Exceptions
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
Parameters
Return Value
mixed | The value in the transformed representation |
Exceptions
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
Parameters
string | $dateTimeLocal | Formatted string |
Return Value
mixed | The value in the original representation |
Exceptions