Unexport epochday procs (#7024)

This commit is contained in:
GULPF 2018-01-03 23:54:36 +01:00 • committed by Andreas Rumpf
commit 30d182e5d6

View file

@ -176,7 +176,7 @@ proc assertValidDate(monthday: MonthdayRange, month: Month, year: int) {.inline.
assert monthday <= getDaysInMonth(month, year), assert monthday <= getDaysInMonth(month, year),
$year & "-" & $ord(month) & "-" & $monthday & " is not a valid date" $year & "-" & $ord(month) & "-" & $monthday & " is not a valid date"
proc toEpochDay*(monthday: MonthdayRange, month: Month, year: int): int64 = proc toEpochDay(monthday: MonthdayRange, month: Month, year: int): int64 =
## Get the epoch day from a year/month/day date. ## Get the epoch day from a year/month/day date.
## The epoch day is the number of days since 1970/01/01 (it might be negative). ## The epoch day is the number of days since 1970/01/01 (it might be negative).
assertValidDate monthday, month, year assertValidDate monthday, month, year
@ -191,7 +191,7 @@ proc toEpochDay*(monthday: MonthdayRange, month: Month, year: int): int64 =
let doe = yoe * 365 + yoe div 4 - yoe div 100 + doy let doe = yoe * 365 + yoe div 4 - yoe div 100 + doy
return era * 146097 + doe - 719468 return era * 146097 + doe - 719468
proc fromEpochDay*(epochday: int64): tuple[monthday: MonthdayRange, month: Month, year: int] = proc fromEpochDay(epochday: int64): tuple[monthday: MonthdayRange, month: Month, year: int] =
## Get the year/month/day date from a epoch day. ## Get the year/month/day date from a epoch day.
## The epoch day is the number of days since 1970/01/01 (it might be negative). ## The epoch day is the number of days since 1970/01/01 (it might be negative).
# Based on http://howardhinnant.github.io/date_algorithms.html # Based on http://howardhinnant.github.io/date_algorithms.html