time

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 2 Imported by: 2

README

time

A simple library to work with time in Go programming language.

Documentation

Index

Constants

View Source
const (
	FormatDayTimeString = "2006-01-02"
)

Time Format.

Variables

This section is empty.

Functions

func AddHours

func AddHours(
	timeStart time.Time,
	timeAddedDeltaHours float64,
) time.Time

func GetLocationOffsetHours

func GetLocationOffsetHours(
	location *time.Location,
) (offsetHrs int, err error)

func GetLocationOffsetSec

func GetLocationOffsetSec(
	location *time.Location,
) (offsetSec int, err error)

func HoursToMicroseconds

func HoursToMicroseconds(
	hours float64,
) time.Duration

func IntervalDurationHours

func IntervalDurationHours(
	timeStart time.Time,
	timeEnd time.Time,
) float64

func IsEmpty

func IsEmpty(
	t time.Time,
) bool

func Maximum

func Maximum(
	a time.Time,
	b time.Time,
) time.Time

func Minimum

func Minimum(
	a time.Time,
	b time.Time,
) time.Time

func NewTimeStringRFC3339

func NewTimeStringRFC3339(
	year uint,
	month uint,
	day uint,
	hour uint,
	minute uint,
	second uint,
) string

func ParseDayTimeStringInLocation

func ParseDayTimeStringInLocation(
	dayTimeString string,
	location *time.Location,
) (dayStartTime time.Time, err error)

func SubHours

func SubHours(
	timeStart time.Time,
	timeSubtractedDeltaHours float64,
) time.Time

func ToDayStart

func ToDayStart(
	timeStart time.Time,
) time.Time

func ToHourStart

func ToHourStart(
	timeStart time.Time,
) time.Time

func ToMinuteStart

func ToMinuteStart(
	timeStart time.Time,
) time.Time

func ToMonthStart

func ToMonthStart(
	timeStart time.Time,
) time.Time

func ToNextMonthStart

func ToNextMonthStart(
	timeStart time.Time,
) time.Time

func ToPreviousMonthStart

func ToPreviousMonthStart(
	timeStart time.Time,
) time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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