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

Method String

tools/types/datetime.go:100–106  ·  view source on GitHub ↗

String serializes the current DateTime instance into a formatted UTC date string. The zero value is serialized to an empty string.

()

Source from the content-addressed store, hash-verified

98//
99// The zero value is serialized to an empty string.
100func (d DateTime) String() string {
101 t := d.Time()
102 if t.IsZero() {
103 return ""
104 }
105 return t.UTC().Format(DefaultDateLayout)
106}
107
108// MarshalJSON implements the [json.Marshaler] interface.
109func (d DateTime) MarshalJSON() ([]byte, error) {

Callers 5

MarshalJSONMethod · 0.95
ValueMethod · 0.95
TestDateTimeStringFunction · 0.95
TestDateTimeScanFunction · 0.95

Calls 2

TimeMethod · 0.95
IsZeroMethod · 0.80

Tested by 3

TestDateTimeStringFunction · 0.76
TestDateTimeScanFunction · 0.76