time: update parse_format comment description in parse.c.v (#22104)

This commit is contained in:
Martin Skou 2024-08-23 13:33:48 +02:00 committed by GitHub
parent 2bf59b14d1
commit f435e9aaf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -131,29 +131,30 @@ pub fn parse(s string) !Time {
} }
// parse_format parses the string `s`, as a custom `format`, containing the following specifiers: // parse_format parses the string `s`, as a custom `format`, containing the following specifiers:
// YYYY - 4 digit year, 0000..9999 //
// YY - 2 digit year, 00..99 // - YYYY - 4 digit year, 0000..9999
// M - month, 1..12 // - YY - 2 digit year, 00..99
// MM - month, 2 digits, 01..12 // - M - month, 1..12
// MMM - month, three letters, Jan..Dec // - MM - month, 2 digits, 01..12
// MMMM - name of month // - MMM - month, three letters, Jan..Dec
// D - day of the month, 1..31 // - MMMM - name of month
// DD - day of the month, 01..31 // - D - day of the month, 1..31
// d - day of week, 0..6 // - DD - day of the month, 01..31
// c - day of week, 1..7 // - d - day of week, 0..6
// dd - day of week, Su..Sa // - c - day of week, 1..7
// ddd - day of week, Sun..Sat // - dd - day of week, Su..Sa
// dddd - day of week, Sunday..Saturday // - ddd - day of week, Sun..Sat
// H - hour, 0..23 // - dddd - day of week, Sunday..Saturday
// HH - hour, 00..23 // - H - hour, 0..23
// h - hour, 0..23 // - HH - hour, 00..23
// hh - hour, 0..23 // - h - hour, 0..23
// k - hour, 0..23 // - hh - hour, 0..23
// kk - hour, 0..23 // - k - hour, 0..23
// m - minute, 0..59 // - kk - hour, 0..23
// mm - minute, 0..59 // - m - minute, 0..59
// s - second, 0..59 // - mm - minute, 0..59
// ss - second, 0..59 // - s - second, 0..59
// - ss - second, 0..59
pub fn parse_format(s string, format string) !Time { pub fn parse_format(s string, format string) !Time {
if s == '' { if s == '' {
return error_invalid_time(0, 'datetime string is empty') return error_invalid_time(0, 'datetime string is empty')