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:
parent
f7efbba32d
commit
05b30ece17
1 changed files with 7 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue