dayzone

package
v0.1.4608 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const MaxStart = 6

MaxStart is the latest hour a day may start at.

Variables

This section is empty.

Functions

func Offset

func Offset(loc *time.Location) time.Duration

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

func Shift(loc *time.Location, hour int) *time.Location

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL