mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibCore: Add DateTime parser for milliseconds
This commit is contained in:
parent
f7efbba32d
commit
05b30ece17
Notes:
sideshowbarker
2024-07-18 05:37:06 +09:00
Author: https://github.com/lanmonster
Commit: 05b30ece17
Pull-request: https://github.com/SerenityOS/serenity/pull/22971
Issue: https://github.com/SerenityOS/serenity/issues/22965
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/trflynn89
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