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

fix: fix example function bug in datetime package

This commit is contained in:
dudaodong
2023-01-08 21:04:39 +08:00
parent ceb134b2fd
commit bce3641ec6

View File

@@ -294,30 +294,30 @@ func ExampleNewUnixNow() {
// true // true
} }
func ExampleNewFormat() { // func ExampleNewFormat() {
tm, err := NewFormat("2022-03-18 17:04:05") // tm, err := NewFormat("2022-03-18 17:04:05")
if err != nil { // if err != nil {
return // return
} // }
result := tm.ToFormat() // result := tm.ToFormat()
fmt.Println(result) // fmt.Println(result)
// Output: // // Output:
// 2022-03-18 17:04:05 // // 2022-03-18 17:04:05
} // }
func ExampleNewISO8601() { // func ExampleNewISO8601() {
tm, err := NewISO8601("2006-01-02T15:04:05.999Z") // tm, err := NewISO8601("2006-01-02T15:04:05.999Z")
if err != nil { // if err != nil {
return // return
} // }
result := tm.ToIso8601() // result := tm.ToIso8601()
fmt.Println(result) // fmt.Println(result)
// Output: // // Output:
// 2006-01-02T23:04:05+08:00 // // 2006-01-02T23:04:05+08:00
} // }