MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Date

Struct Date

postgres/parser/pgdate/pgdate.go:74–85  ·  view source on GitHub ↗

Date is a postgres-compatible date implementation. It stores the number of days from the postgres epoch (2000-01-01). Its properties are unexported so that it cannot be misused by external packages. This package takes care to prevent silent problems like overflow that can occur when adding days or c

Source from the content-addressed store, hash-verified

72// package takes care to prevent silent problems like overflow that can
73// occur when adding days or converting to and from a time.Time.
74type Date struct {
75 days int32
76
77 // orig is the original on-disk number of days. It is only set when
78 // creating a Date from an on-disk encoding and will be used instead
79 // of days when encoding for on-disk. This is required so that we
80 // can roundtrip to the same on-disk value, which is necessary for
81 // deleting old index entries. This value should never be copied
82 // to another Date, but always cleared and forgotten on any mutation.
83 hasOrig bool
84 orig int64
85}
86
87// MakeCompatibleDateFromDisk creates a Date from the number of days
88// since the Unix epoch. If it is out of range of LowDate and HighDate,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected