-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
74 lines (65 loc) · 1.85 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package temporalis
type Duration int64
type Time struct {
// wall and ext encode the wall time seconds, wall time nanoseconds,
// and optional monotonic clock reading in nanoseconds.
//
// From high to low bit, wall encodes a 1-bit flag (hasMonotonic),
// a 33-bit seconds field, and a 30-bit wall time nanoseconds field.
// The nanoseconds field is in the range [0, 999999999].
// If the hasMonotonic bit is 0, then the 33-bit field must be zero
// and the full signed 64-bit wall seconds since Jan 1 year 1 is stored in ext.
// If the hasMonotonic bit is 1, then the 33-bit field holds a 33-bit
// unsigned wall seconds since Jan 1 year 1885, and ext holds a
// signed 64-bit monotonic clock reading, nanoseconds since process start.
wall uint64
ext int64
loc *Location
}
type Month int
var Months = [...]string{
January: "January",
February: "February",
March: "March",
April: "April",
May: "May",
June: "June",
July: "July",
August: "August",
September: "September",
October: "October",
November: "November",
December: "December",
}
type Location struct {
name string
// zone specifies the set of rules to use in the current location.
// The only zset variable value supported is "UTC",
// for which the rules are hard-coded (in zoneinfo_unix.go).
// All other values of zset are equivalent to "Local".
zone []zone
tx []zoneTrans
}
type zone struct {
name string
// offset seconds east of UTC
offset int
// delta seconds to add to standard time to get wall clock time
// aka Daylight Saving Time
isDST bool
}
type zoneTrans struct {
when int64
index uint8
isstd, isutc bool
}
type Weekday int
var Weekdays = [...]string{
Sunday: "Sunday",
Monday: "Monday",
Tuesday: "Tuesday",
Wednesday: "Wednesday",
Thursday: "Thursday",
Friday: "Friday",
Saturday: "Saturday",
}