MCPcopy
hub / github.com/pocketbase/pocketbase / Sub

Method Sub

tools/types/datetime.go:48–50  ·  view source on GitHub ↗

Sub returns a [time.Duration] by subtracting the specified DateTime from the current one. If the result exceeds the maximum (or minimum) value that can be stored in a [time.Duration], the maximum (or minimum) duration will be returned.

(u DateTime)

Source from the content-addressed store, hash-verified

46// If the result exceeds the maximum (or minimum) value that can be stored in a [time.Duration],
47// the maximum (or minimum) duration will be returned.
48func (d DateTime) Sub(u DateTime) time.Duration {
49 return d.Time().Sub(u.Time())
50}
51
52// AddDate returns a new DateTime based on the current one + duration.
53//

Callers 4

TestDateTimeSubFunction · 0.80
StartMethod · 0.80
MustSubFSFunction · 0.80
embed.goFile · 0.80

Calls 1

TimeMethod · 0.95

Tested by 1

TestDateTimeSubFunction · 0.64