MCPcopy
hub / github.com/perkeep/perkeep / RFC3339FromTime

Function RFC3339FromTime

pkg/schema/schema.go:935–943  ·  view source on GitHub ↗

RFC3339FromTime returns an RFC3339-formatted time. If the timezone is known, the time will be converted to UTC and returned with a "Z" suffix. For unknown zones, the timezone will be "-00:01" (1 minute west of UTC). Fractional seconds are only included if the time has fractional seconds.

(t time.Time)

Source from the content-addressed store, hash-verified

933// Fractional seconds are only included if the time has fractional
934// seconds.
935func RFC3339FromTime(t time.Time) string {
936 if IsZoneKnown(t) {
937 t = t.UTC()
938 }
939 if t.UnixNano()%1e9 == 0 {
940 return t.Format(time.RFC3339)
941 }
942 return t.Format(time.RFC3339Nano)
943}
944
945var bytesCamliVersion = []byte("camliVersion")
946

Callers 15

importTransactionMethod · 0.92
importTweetMethod · 0.92
importCheckinMethod · 0.92
importItemMethod · 0.92
updatePhotoMethod · 0.92
importBookmarkMethod · 0.92
importHighlightMethod · 0.92
importAlbumMethod · 0.92
updatePhotoInAlbumMethod · 0.92
importPhotoMethod · 0.92
importPostMethod · 0.92
importStatusMethod · 0.92

Calls 1

IsZoneKnownFunction · 0.85

Tested by 2

TestRFC3339Function · 0.68