timeutil

package
v0.0.0-...-5a547ea Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultParseHHMMSS

func DefaultParseHHMMSS(value string) (time.Time, error)

DefaultParseHHMMSS is like ParseHHMMSS but differs in one way, define the format as

15:04:05

func DefaultParseTodayHHMMSS

func DefaultParseTodayHHMMSS(value string) (time.Time, error)

DefaultParseTodayHHMMSS is like ParseTodayHHMMSS but differs in one way, define the format as

15:04:05

func FirstTime

func FirstTime(year int, month time.Month, day int) time.Time

FirstTime return first time(00:00:00) with year, month and day

func FirstTimeOffsetDays

func FirstTimeOffsetDays(days int) time.Time

FirstTimeOffsetDays like as FirstTimeToday but offset days

func FirstTimeToday

func FirstTimeToday() time.Time

FirstTimeToday return first time(00:00:00) of today

func FirstTimeTomorrow

func FirstTimeTomorrow() time.Time

FirstTimeToday return first time(00:00:00) of tomorrow

func FirstTimeYesterday

func FirstTimeYesterday() time.Time

FirstTimeToday return first time(00:00:00) of yesterday

func LastTime

func LastTime(year int, month time.Month, day int) time.Time

LastTime return last time(23:59:59.999999999) with year, month and day

func LastTimeOffsetDays

func LastTimeOffsetDays(days int) time.Time

LastTimeOffsetDays like as LastTimeToday but offset days

func LastTimeToday

func LastTimeToday() time.Time

LastTimeToday return last time(23:59:59.999999999) of today

func LastTimeTomorrow

func LastTimeTomorrow() time.Time

LastTimeToday return last time(23:59:59.999999999) of tomorrow

func LastTimeYesterday

func LastTimeYesterday() time.Time

LastTimeToday return last time(23:59:59.999999999) of yesterday

func ParseHHMMSS

func ParseHHMMSS(layout, value string) (time.Time, error)

ParseHHMMSS is like ParseTodayHHMMSS but differs in one important way, returns the time default today if before now, else define yesterday.

func ParseTodayHHMMSS

func ParseTodayHHMMSS(layout, value string) (time.Time, error)

ParseTodayHHMMSS parses a formatted string and returns the time value it represents. The layout defines the format by showing how the reference time, defined to be

15:04:05

would be interpreted if it were the value; it serves as an example of the input format. The same interpretation will then be made to the input string. ParseTodayHHMMSS returns a time in Local`s UTC, and force define year, month and day same as today.

func Today

func Today(hour, min, sec, nsec int) time.Time

Today return time with year, month and day of today, and with hour, min, sec and nsec

Types

This section is empty.

Jump to

Keyboard shortcuts

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