Documentation
¶
Overview ¶
Package dayzone makes a time zone whose midnight falls at a chosen hour of the real day, so that every place that cuts days by the zone's midnight (the Usage page, a daily cap) cuts them there without knowing: with a day that starts at 4, a call at 01:30 belongs to the day before (ssharpcc on X: coding past 1am should count toward the day before).
Index ¶
Constants ¶
const MaxStart = 6
MaxStart is the latest hour a day may start at.
Variables ¶
This section is empty.
Functions ¶
func Offset ¶
Offset is how far loc's midnight lies after the real midnight: the hour a shifted zone's day starts at, 0 for any other.
func Shift ¶
Shift is loc moved so that its midnight is the real day's hour:00: the same offsets, hour hours less each, with the same changes of daylight saving at the same instants. An hour outside 1 to MaxStart is loc itself. The same location comes back for the same loc and hour, so a Filter holding it is the same cache key each time.
Types ¶
This section is empty.