mirror of
https://github.com/vlang/v.git
synced 2025-09-16 10:57:25 -04:00
time: update parse_format comment description in parse.c.v (#22104)
This commit is contained in:
parent
2bf59b14d1
commit
f435e9aaf3
@ -131,29 +131,30 @@ pub fn parse(s string) !Time {
|
||||
}
|
||||
|
||||
// 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
|
||||
// M - month, 1..12
|
||||
// MM - month, 2 digits, 01..12
|
||||
// MMM - month, three letters, Jan..Dec
|
||||
// MMMM - name of month
|
||||
// D - day of the month, 1..31
|
||||
// DD - day of the month, 01..31
|
||||
// d - day of week, 0..6
|
||||
// c - day of week, 1..7
|
||||
// dd - day of week, Su..Sa
|
||||
// ddd - day of week, Sun..Sat
|
||||
// dddd - day of week, Sunday..Saturday
|
||||
// H - hour, 0..23
|
||||
// HH - hour, 00..23
|
||||
// h - hour, 0..23
|
||||
// hh - hour, 0..23
|
||||
// k - hour, 0..23
|
||||
// kk - hour, 0..23
|
||||
// m - minute, 0..59
|
||||
// mm - minute, 0..59
|
||||
// s - second, 0..59
|
||||
// ss - second, 0..59
|
||||
//
|
||||
// - YYYY - 4 digit year, 0000..9999
|
||||
// - YY - 2 digit year, 00..99
|
||||
// - M - month, 1..12
|
||||
// - MM - month, 2 digits, 01..12
|
||||
// - MMM - month, three letters, Jan..Dec
|
||||
// - MMMM - name of month
|
||||
// - D - day of the month, 1..31
|
||||
// - DD - day of the month, 01..31
|
||||
// - d - day of week, 0..6
|
||||
// - c - day of week, 1..7
|
||||
// - dd - day of week, Su..Sa
|
||||
// - ddd - day of week, Sun..Sat
|
||||
// - dddd - day of week, Sunday..Saturday
|
||||
// - H - hour, 0..23
|
||||
// - HH - hour, 00..23
|
||||
// - h - hour, 0..23
|
||||
// - hh - hour, 0..23
|
||||
// - k - hour, 0..23
|
||||
// - kk - hour, 0..23
|
||||
// - m - minute, 0..59
|
||||
// - mm - minute, 0..59
|
||||
// - s - second, 0..59
|
||||
// - ss - second, 0..59
|
||||
pub fn parse_format(s string, format string) !Time {
|
||||
if s == '' {
|
||||
return error_invalid_time(0, 'datetime string is empty')
|
||||
|
Loading…
x
Reference in New Issue
Block a user