MCPcopy
hub / github.com/pocketbase/pocketbase / ParseDateTime

Function ParseDateTime

tools/types/datetime.go:21–25  ·  view source on GitHub ↗

ParseDateTime creates a new DateTime from the provided value (could be [cast.ToTime] supported string, [time.Time], etc.).

(value any)

Source from the content-addressed store, hash-verified

19// ParseDateTime creates a new DateTime from the provided value
20// (could be [cast.ToTime] supported string, [time.Time], etc.).
21func ParseDateTime(value any) (DateTime, error) {
22 d := DateTime{}
23 err := d.Scan(value)
24 return d, err
25}
26
27// DateTime represents a [time.Time] instance in UTC that is wrapped
28// and serialized using the app default date layout.

Callers 15

TestParseDateTimeFunction · 0.92
TestDateTimeTimeFunction · 0.92
TestDateTimeAddFunction · 0.92
TestDateTimeSubFunction · 0.92
TestDateTimeAddDateFunction · 0.92
TestDateTimeAfterFunction · 0.92
TestDateTimeBeforeFunction · 0.92
TestDateTimeCompareFunction · 0.92
TestDateTimeEqualFunction · 0.92
TestDateTimeUnixFunction · 0.92
TestDateTimeStringFunction · 0.92
TestDateTimeMarshalJSONFunction · 0.92

Calls 1

ScanMethod · 0.95

Tested by 15

TestParseDateTimeFunction · 0.74
TestDateTimeTimeFunction · 0.74
TestDateTimeAddFunction · 0.74
TestDateTimeSubFunction · 0.74
TestDateTimeAddDateFunction · 0.74
TestDateTimeAfterFunction · 0.74
TestDateTimeBeforeFunction · 0.74
TestDateTimeCompareFunction · 0.74
TestDateTimeEqualFunction · 0.74
TestDateTimeUnixFunction · 0.74
TestDateTimeStringFunction · 0.74
TestDateTimeMarshalJSONFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…