1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

LibCore: Add DateTime parser for milliseconds

This commit is contained in:
Kyle Lanmon 2024-01-28 23:35:29 -06:00 committed by Andreas Kling
parent f7efbba32d
commit 05b30ece17

View file

@ -530,6 +530,13 @@ Optional<DateTime> DateTime::parse(StringView format, StringView string)
tm.tm_min -= minutes;
break;
}
case 'X': {
if (!string_lexer.consume_specific('.'))
return {};
auto discarded = parse_number();
(void)discarded; // NOTE: the tm structure does not support sub second precision, so drop this value.
break;
}
case 'Z':
parsed_time_zone = parse_time_zone_name(string_lexer);
if (!parsed_time_zone.has_value())