MCPcopy Index your code
hub / github.com/pocketbase/pocketbase / TestDateTimeAdd

Function TestDateTimeAdd

tools/types/datetime_test.go:78–93  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestDateTimeAdd(t *testing.T) {
79 t.Parallel()
80
81 d1, _ := types.ParseDateTime("2024-01-01 10:00:00.123Z")
82
83 d2 := d1.Add(1 * time.Hour)
84
85 if d1.String() != "2024-01-01 10:00:00.123Z" {
86 t.Fatalf("Expected d1 to remain unchanged, got %s", d1.String())
87 }
88
89 expected := "2024-01-01 11:00:00.123Z"
90 if d2.String() != expected {
91 t.Fatalf("Expected d2 %s, got %s", expected, d2.String())
92 }
93}
94
95func TestDateTimeSub(t *testing.T) {
96 t.Parallel()

Callers

nothing calls this directly

Calls 3

ParseDateTimeFunction · 0.92
AddMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…