gregorian

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package gregorian provides utility functions for the Gregorian calendar calculations. The Gregorian calendar was officially introduced on 15th October 1582 so, strictly speaking, it only applies after that date. Some countries did not switch to the Gregorian calendar for many years after (such as Great Britain in 1782).

Extending the Gregorian calendar backwards to dates preceding its official introduction produces a proleptic calendar that should be used with some caution for historic dates because it can lead to confusion.

See https://en.wikipedia.org/wiki/Gregorian_calendar https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaysIn

func DaysIn(year int, month time.Month) int

DaysIn gives the number of days in a given month, according to the Gregorian calendar.

func DaysInYear

func DaysInYear(year int) int

DaysInYear gives the number of days in a given year, according to the Gregorian calendar.

func IsLeap

func IsLeap(year int) bool

IsLeap simply tests whether a given year is a leap year, using the Gregorian calendar algorithm.

Types

This section is empty.

Jump to

Keyboard shortcuts

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