MCPcopy Create free account
hub / github.com/buggregator/server / parseRFC3339

Function parseRFC3339

modules/sentry/api_traces.go:217–229  ·  view source on GitHub ↗

parseRFC3339 tries multiple time formats for stored timestamps.

(s string)

Source from the content-addressed store, hash-verified

215
216// parseRFC3339 tries multiple time formats for stored timestamps.
217func parseRFC3339(s string) (time.Time, error) {
218 for _, layout := range []string{
219 time.RFC3339Nano,
220 time.RFC3339,
221 "2006-01-02T15:04:05Z",
222 "2006-01-02 15:04:05",
223 } {
224 if t, err := time.Parse(layout, s); err == nil {
225 return t, nil
226 }
227 }
228 return time.Time{}, fmt.Errorf("cannot parse time: %s", s)
229}

Callers 1

computeOffsetMSFunction · 0.85

Calls 1

ParseMethod · 0.80

Tested by

no test coverage detected