MCPcopy Index your code
hub / github.com/duke-git/lancet / ExampleAddDay

Function ExampleAddDay

datetime/datetime_example_test.go:9–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7)
8
9func ExampleAddDay() {
10 date, _ := time.Parse("2006-01-02 15:04:05", "2021-01-01 00:00:00")
11
12 after1Day := AddDay(date, 1)
13 before1Day := AddDay(date, -1)
14
15 fmt.Println(after1Day.Format("2006-01-02 15:04:05"))
16 fmt.Println(before1Day.Format("2006-01-02 15:04:05"))
17
18 // Output:
19 // 2021-01-02 00:00:00
20 // 2020-12-31 00:00:00
21}
22
23func ExampleAddWeek() {
24 date, _ := time.Parse("2006-01-02", "2021-01-01")

Callers

nothing calls this directly

Calls 2

AddDayFunction · 0.85
FormatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…