1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 14:42:27 +08:00

fix: timeFormat["yyyy-mm-dd hh"] should be "2006-01-02 15" (#99) (#100)

* fix: timeFormat["yyyy-mm-dd hh"] should be "2006-01-02 15" (#99)

* test: add use cases for FormatTimeToStr
This commit is contained in:
燕归来
2023-05-29 20:08:17 +08:00
committed by GitHub
parent b1fcfce188
commit a33ea3d013
3 changed files with 10 additions and 3 deletions

View File

@@ -131,15 +131,18 @@ func ExampleFormatTimeToStr() {
result1 := FormatTimeToStr(datetime, "yyyy-mm-dd hh:mm:ss")
result2 := FormatTimeToStr(datetime, "yyyy-mm-dd")
result3 := FormatTimeToStr(datetime, "dd-mm-yy hh:mm:ss")
result4 := FormatTimeToStr(datetime, "yyyy-mm-dd hh")
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
fmt.Println(result4)
// Output:
// 2021-01-02 16:04:08
// 2021-01-02
// 02-01-21 16:04:08
// 2021-01-02 16
}
func ExampleFormatStrToTime() {