Closed joelbutcher closed 8 months ago
Hi, your string is the ISO 8601 representation of a date-time with a timezone, which is represented in brick/date-time by ZonedDateTime
:
\Brick\DateTime\ZonedDateTime::parse('2024-03-11T00:00:00.000Z'); // works
If you need only the date part (a LocalDate
), you can call ZonedDateTime::getDate()
:
\Brick\DateTime\ZonedDateTime::parse('2024-03-11T00:00:00.000Z')->getDate();
Or pass just the date part to LocalDate::parse()
:
\Brick\DateTime\LocalDate::parse('2024-03-11'); // works
Trying to parse the following:
results in: