date

package
v1.19.1-rc-multipart Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: AGPL-3.0 Imports: 1 Imported by: 1

Documentation

Overview

Package date contains various date-related utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DayBoundary

func DayBoundary(t time.Time) (time.Time, time.Time)

DayBoundary returns start and end of the provided day.

func MonthBoundary

func MonthBoundary(t time.Time) (time.Time, time.Time)

MonthBoundary extract month from the provided date and returns its edges.

func MonthsBetweenDates added in v1.6.1

func MonthsBetweenDates(from time.Time, to time.Time) int

MonthsBetweenDates calculates amount of months between two dates.

func MonthsCountSince added in v1.3.2

func MonthsCountSince(from time.Time) int

MonthsCountSince calculates the months between now and the createdAtTime time.Time value passed.

func PeriodToTime added in v1.1.1

func PeriodToTime(period string) (_ time.Time, err error)

PeriodToTime returns time.Time period in format YYYY-MM from string.

func TruncateToHourInNano added in v1.8.1

func TruncateToHourInNano(t time.Time) int64

TruncateToHourInNano returns the time truncated to the hour in nanoseconds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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