Documentation
¶
Index ¶
Constants ¶
const ShortTimeFormat string = "15:04:05.999"
ShortTimeFormat is the standard time.Time format used for showing just the timestamp portion of a Ticks value.
const TimeFormat string = "2006-01-02 15:04:05.999999999"
TimeFormat is the standard time.Time format used for a Ticks value.
Variables ¶
This section is empty.
Functions ¶
func IsLeapSecond ¶
IsLeapSecond determines if the deserialized Ticks value represents a leap second, i.e., second 60.
Types ¶
type Ticks ¶
type Ticks uint64
Ticks is a 64-bit integer used to designate time in STTP. The value represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001 UTC, Gregorian calendar. A single tick represents one hundred nanoseconds, or one ten-millionth of a second. There are 10,000 ticks in a millisecond and 10 million ticks in a second. Only bits 01 to 62 (0x3FFFFFFFFFFFFFFF) are used to represent the timestamp value. Bit 64 (0x8000000000000000) is used to denote leap second, i.e., second 60, where actual second value would remain at 59. Bit 63 is reserved and unset.
const LeapSecondFlag Ticks = 1 << 63
LeapSecondFlag is the flag (64th bit) that marks a Ticks value as a leap second, i.e., second 60 (one beyond normal second 59).
const Max Ticks = 3155378975999999999
Max is the maximum value for Ticks. It represents UTC time 12/31/1999 11:59:59.999.
const Min Ticks = 0
Min is the minimum value for Ticks. It represents UTC time 01/01/0001 00:00:00.000.
PerMicrosecond is the number of Ticks that occur in a microsecond.
PerMillisecond is the number of Ticks that occur in a millisecond.
const PerSecond Ticks = 10000000
PerSecond is the number of Ticks that occur in a second.
const ReservedUTCFlag Ticks = 1 << 62
ReservedUTCFlag is the reserved flag (63rd bit) that should be unset when serializing and deserializing Ticks.
const UnixBaseOffset Ticks = 621355968000000000
UnixBaseOffset is the Ticks representation of the Unix epoch timestamp starting at January 1, 1970.
const ValueMask Ticks = ^LeapSecondFlag & ^ReservedUTCFlag
ValueMask defines all bits (bits 1 to 62) that make up the value portion of a Ticks that represent time.
func SetLeapSecond ¶
SetLeapSecond flags a Ticks value to represent a leap second, i.e., second 60, before wire serialization.
func (Ticks) IsLeapSecond ¶ added in v0.5.0
IsLeapSecond determines if the deserialized Ticks value represents a leap second, i.e., second 60.
func (Ticks) SetLeapSecond ¶ added in v0.5.0
SetLeapSecond flags a Ticks value to represent a leap second, i.e., second 60, before wire serialization.
func (Ticks) ShortTime ¶ added in v0.5.0
ShortTime returns the short time string form of a Ticks value.