MCPcopy
hub / github.com/duke-git/lancet / ExampleAddMinute

Function ExampleAddMinute

datetime/datetime_example_test.go:65–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63}
64
65func ExampleAddMinute() {
66 date, _ := time.Parse("2006-01-02 15:04:05", "2021-01-01 00:00:00")
67
68 after2Minutes := AddMinute(date, 2)
69 before2Minutes := AddMinute(date, -2)
70
71 fmt.Println(after2Minutes.Format("2006-01-02 15:04:05"))
72 fmt.Println(before2Minutes.Format("2006-01-02 15:04:05"))
73
74 // Output:
75 // 2021-01-01 00:02:00
76 // 2020-12-31 23:58:00
77}
78
79func ExampleAddYear() {
80 date, _ := time.Parse("2006-01-02", "2021-01-01")

Callers

nothing calls this directly

Calls 2

AddMinuteFunction · 0.85
FormatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…