dateutil

package
v0.0.0-...-2a5cec1 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DateFormat defines the display date format
	DateFormat = "2006/01/02 15:04:05"

	// DurationPrecision defines the precision for formatted durations
	DurationPrecision = time.Second
)

DateFormat and DurationPrecision are variables so that they can be customized at runtime if needed.

Functions

func BeginOfDay

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

BeginOfDay returns a date which represents the beginning of the day

func Format

func Format(date time.Time) string

Format formats date using the defined DateFormat

func FormatDuration

func FormatDuration(duration time.Duration) string

FormatDuration formats a duration

func ParseDate

func ParseDate(s string, defaultValue ...time.Time) (time.Time, error)

ParseDate parses a date from given string. It will return the optional default value if s is empty and an error if s does not match any known date format

Types

This section is empty.

Jump to

Keyboard shortcuts

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