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

Method UnixEpochDays

postgres/parser/pgdate/pgdate.go:210–219  ·  view source on GitHub ↗

UnixEpochDays returns the number of days since the Unix epoch. Infinite dates are converted to MinInt64 or MaxInt64.

()

Source from the content-addressed store, hash-verified

208// UnixEpochDays returns the number of days since the Unix epoch. Infinite
209// dates are converted to MinInt64 or MaxInt64.
210func (d Date) UnixEpochDays() int64 {
211 if d.days == math.MinInt32 {
212 return math.MinInt64
213 }
214 if d.days == math.MaxInt32 {
215 return math.MaxInt64
216 }
217 // Converting to an int64 makes overflow impossible.
218 return int64(d.days) + unixEpochToPGEpoch
219}
220
221// UnixEpochDaysWithOrig returns the original on-disk representation if
222// present, otherwise UnixEpochDays().

Callers 2

ToTimeMethod · 0.95
UnixEpochDaysWithOrigMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected