tempus

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

Tempus provides some useful time-related functions that are not found in the standard time package.

Index

Constants

View Source
const (
	FormatTimestamp = "20060102.150405"
	FormatISO8601   = "2006-01-02T15:04:05"
	FormatHTTP      = "Mon, 02 Jan 2006 15:04:05 GMT"
)

Variables

This section is empty.

Functions

func DaysInMonth

func DaysInMonth(t time.Time) int

DaysInMonth returns the number of days in the month that the time lies within.

func DaysInYear

func DaysInYear(t time.Time) int

DaysInYear returns the number of days in the year that the time lies within.

func HasTimezoneInfo added in v1.1.0

func HasTimezoneInfo() bool

HasTimezoneInfo returns true if the timezone info file can be found

func IsLeapYear

func IsLeapYear(t time.Time) bool

IsLeapYear returns true if the given year is a leap year.

func TimezoneNames added in v1.1.0

func TimezoneNames() []string

TimezoneNames returns the list of names of valid timezones

Types

This section is empty.

Jump to

Keyboard shortcuts

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