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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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