1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

time: add a format_rfc3339_nano() method to time.Time

This commit is contained in:
Delyan Angelov
2023-08-08 08:33:05 +03:00
parent 320057df1c
commit 286d39706b
2 changed files with 21 additions and 8 deletions

View File

@ -89,6 +89,13 @@ fn test_format_rfc3339() {
assert res.contains('T')
}
fn test_format_rfc3339_nano() {
res := time_to_test.format_rfc3339_nano()
assert res.ends_with('23:42.123456789Z')
assert res.starts_with('1980-07-1')
assert res.contains('T')
}
fn test_format_ss() {
assert '11.07.1980 21:23:42' == time_to_test.get_fmt_str(.dot, .hhmmss24, .ddmmyyyy)
}