time_helpers

package module
v0.0.0-...-eb80545 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 6 Imported by: 2

README

time-helpers

Time helpers

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadFormat = i18nmod.Err(group + ".err_bad_format")

	ErrBadHour   = i18nmod.ErrData{Group: group + ".err_", Key: "bad_hour"}
	ErrBadMinute = i18nmod.ErrData{Group: group + ".err_", Key: "bad_minute"}
	ErrBadSecond = i18nmod.ErrData{Group: group + ".err_", Key: "bad_second"}
)

Functions

func LocToGmtS

func LocToGmtS(loc *time.Location) string

LocToGmtS returns location in format "GMT -07:00"

func MustParseTime

func MustParseTime(now time.Time, v string) time.Time

func Offset

func Offset(loc *time.Location) (hour, minute int)

OffsetS returns hour and minute location offset

func OffsetM

func OffsetM(loc *time.Location) (hour, minute, monotonic int)

OffsetS returns hour and minute location offset

func OffsetMS

func OffsetMS(loc *time.Location) string

OffsetS returns location offset in format -07:00

func OffsetS

func OffsetS(loc *time.Location) string

OffsetS returns location offset in format -07:00

func ParseHtml5Input

func ParseHtml5Input(v string, loc ...*time.Location) (t time.Time, err error)

ParseHtml5Input parses html5 datetime-local field value

func ParseTime

func ParseTime(now time.Time, v string) (t time.Time, err error)

func SetLoc

func SetLoc(t time.Time, loc *time.Location) (r time.Time)

SetLoc retuns new time with location

func TimeF

func TimeF(t time.Time) string

func TimeS

func TimeS(t time.Time) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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