MCPcopy Create free account
hub / github.com/crewjam/saml / formatTime

Function formatTime

time.go:15–17  ·  view source on GitHub ↗

formatTime formats t for a SAML message. saml-core §1.3.3 says SAML time values "MUST be expressed in UTC form, with no time zone component", so t is converted to UTC first; a time in another zone would otherwise keep its offset. Fractions finer than a millisecond are dropped.

(t time.Time)

Source from the content-addressed store, hash-verified

13// is converted to UTC first; a time in another zone would otherwise keep
14// its offset. Fractions finer than a millisecond are dropped.
15func formatTime(t time.Time) string {
16 return t.UTC().Format(timeFormat)
17}
18
19// optionalRelaxedTime returns t as a *RelaxedTime, or nil if t is the zero
20// time. It is used for optional time attributes, so that MarshalXML leaves

Callers 11

ElementMethod · 0.85
ElementMethod · 0.85
ElementMethod · 0.85
ElementMethod · 0.85
ElementMethod · 0.85
ElementMethod · 0.85
CanonicalElementMethod · 0.85
ElementMethod · 0.85
ElementMethod · 0.85
ElementMethod · 0.85
ElementMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected