Help us shape the future of Go! Take the 2026 Go Developer Survey

days

package module
v0.0.0-...-1d0cc92 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2016 License: MIT Imports: 1 Imported by: 0

README

Tool to calculate natural day set

Today() time.Time

Returns today's time to midnight

Tomorrow(tm time.Time) time.Time

Returns tomorrow's time by adding one day to the given time

Yesterday(tm time.Time) time.Time

Returns tomorrow's time by subtracting one day from the given time

Between(t1, t2 time.Time) (days int)

Calculates the difference between two times in days

Add(tm time.Time, n int) time.Time

Adds "n" days to a given time

Sub(tm time.Time, n int) time.Time

Subtracts "n" days to a given time

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(tm time.Time, n int) (ret time.Time)

Adds "n" days to a given time

func Between

func Between(t1, t2 time.Time) int

Calculates the difference between two times in days

func Days

func Days(tm time.Time) int

func Sub

func Sub(tm time.Time, n int) (ret time.Time)

Subtracts "n" days to a given time

func Today

func Today() time.Time

Returns today's time to midnight

func Tomorrow

func Tomorrow(tm time.Time) time.Time

Returns tomorrow's time by adding one day to the given time

func Trunc

func Trunc(tm time.Time) time.Time

Returns date with the time portion of the day truncated

func Yesterday

func Yesterday(tm time.Time) time.Time

Returns tomorrow's time by subtracting one day from the given time

Types

This section is empty.

Jump to

Keyboard shortcuts

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