File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 14
14
package model
15
15
16
16
import (
17
+ "math"
17
18
"strconv"
18
19
19
20
native_time "time"
20
21
)
21
22
22
- // TODO(julius): Should this use milliseconds/nanoseconds instead? This is
23
- // mostly hidden from the user of these types when using the
24
- // methods below, so it will be easy to change this later
25
- // without requiring significant user code changes.
26
-
27
- // Timestamp is the number of seconds since the epoch (1970-01-01 00:00 UTC)
28
- // without leap seconds.
23
+ // Timestamp is the number of milliseconds since the epoch
24
+ // (1970-01-01 00:00 UTC) excluding leap seconds.
29
25
type Timestamp int64
30
26
31
27
const (
@@ -36,6 +32,13 @@ const (
36
32
second = int64 (native_time .Second / MinimumTick )
37
33
// The number of nanoseconds per minimum tick.
38
34
nanosPerTick = int64 (MinimumTick / native_time .Nanosecond )
35
+
36
+ // Earliest is the earliest timestamp representable. Handy for
37
+ // initializing a high watermark.
38
+ Earliest = Timestamp (math .MinInt64 )
39
+ // Latest is the latest timestamp representable. Handy for initializing
40
+ // a low watermark.
41
+ Latest = Timestamp (math .MaxInt64 )
39
42
)
40
43
41
44
// Equal reports whether two timestamps represent the same instant.
You can’t perform that action at this time.
0 commit comments