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

time: add str()

This commit is contained in:
nsauk
2020-01-20 17:06:15 +03:00
committed by Alexander Medvednikov
parent 9b3ac7efa4
commit 84438c0139
2 changed files with 50 additions and 55 deletions

View File

@@ -483,3 +483,9 @@ pub fn (t Time) get_fmt_str(fmt_dlmtr FormatDelimiter, fmt_time FormatTime, fmt_
}
}
}
// `str` returns time in the same format as `parse` expects: "2018-01-27 12:48:34"
// TODO define common default format for `str` and `parse` and use it in both ways
pub fn (t Time) str() string {
return t.format_ss()
}