mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
time: add .format_ss_milli and .format_ss_micro methods
This commit is contained in:
parent
0af415fa28
commit
8f23accc4e
4 changed files with 33 additions and 1 deletions
|
@ -8,6 +8,7 @@ const (
|
|||
hour: 21
|
||||
minute: 23
|
||||
second: 42
|
||||
microsecond: 123456
|
||||
unix: 332198622
|
||||
}
|
||||
)
|
||||
|
@ -87,6 +88,16 @@ fn test_format_ss() {
|
|||
assert '11.07.1980 21:23:42' == time_to_test.get_fmt_str(.dot, .hhmmss24, .ddmmyyyy)
|
||||
}
|
||||
|
||||
fn test_format_ss_milli() {
|
||||
assert '11.07.1980 21:23:42.123' == time_to_test.get_fmt_str(.dot, .hhmmss24_milli, .ddmmyyyy)
|
||||
assert '1980-07-11 21:23:42.123' == time_to_test.format_ss_milli()
|
||||
}
|
||||
|
||||
fn test_format_ss_micro() {
|
||||
assert '11.07.1980 21:23:42.123456' == time_to_test.get_fmt_str(.dot, .hhmmss24_micro, .ddmmyyyy)
|
||||
assert '1980-07-11 21:23:42.123456' == time_to_test.format_ss_micro()
|
||||
}
|
||||
|
||||
fn test_smonth() {
|
||||
month_names := ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
||||
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue