date

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatISO8601

func FormatISO8601(t time.Time) string

Format timestamps in a ISO 8601-like format (same as in Git command)

func FormatRFC2822

func FormatRFC2822(t time.Time) string

Format timestamps in RFC 2822 format, often found in email messages (same as in Git command)

func FormatRelative

func FormatRelative(t time.Time) string

func FormatWithType

func FormatWithType(t time.Time, f Format) string

func Parse

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

func ParseAbsolute

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

func SetNow

func SetNow(f func() time.Time)

Types

type Format

type Format string
const (
	RFC2822  Format = "rfc2822"
	ISO8601  Format = "iso8601"
	Relative Format = "relative"
)

Jump to

Keyboard shortcuts

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