MCPcopy
hub / github.com/uber-go/zap / EpochMillisTimeEncoder

Function EpochMillisTimeEncoder

zapcore/encoder.go:111–115  ·  view source on GitHub ↗

EpochMillisTimeEncoder serializes a time.Time to a floating-point number of milliseconds since the Unix epoch.

(t time.Time, enc PrimitiveArrayEncoder)

Source from the content-addressed store, hash-verified

109// EpochMillisTimeEncoder serializes a time.Time to a floating-point number of
110// milliseconds since the Unix epoch.
111func EpochMillisTimeEncoder(t time.Time, enc PrimitiveArrayEncoder) {
112 nanos := t.UnixNano()
113 millis := float64(nanos) / float64(time.Millisecond)
114 enc.AppendFloat64(millis)
115}
116
117// EpochNanosTimeEncoder serializes a time.Time to an integer number of
118// nanoseconds since the Unix epoch.

Callers

nothing calls this directly

Calls 1

AppendFloat64Method · 0.65

Tested by

no test coverage detected