1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +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
}
func ExampleNewFormat() {
tm, err := NewFormat("2022-03-18 17:04:05")
if err != nil {
return
}
// func ExampleNewFormat() {
// tm, err := NewFormat("2022-03-18 17:04:05")
// if err != nil {
// return
// }
result := tm.ToFormat()
// result := tm.ToFormat()
fmt.Println(result)
// fmt.Println(result)
// Output:
// 2022-03-18 17:04:05
}
// // Output:
// // 2022-03-18 17:04:05
// }
func ExampleNewISO8601() {
tm, err := NewISO8601("2006-01-02T15:04:05.999Z")
if err != nil {
return
}
// func ExampleNewISO8601() {
// tm, err := NewISO8601("2006-01-02T15:04:05.999Z")
// if err != nil {
// return
// }
result := tm.ToIso8601()
// result := tm.ToIso8601()
fmt.Println(result)
// fmt.Println(result)
// Output:
// 2006-01-02T23:04:05+08:00
}
// // Output:
// // 2006-01-02T23:04:05+08:00
// }