chrono

package
v0.0.0-...-f714a01 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2016 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(t time.Time) string

Format returns a string representation of the time.

func FormatNano

func FormatNano(t time.Time) string

FormatNano returns a string representation of the time with nanosecond resolution.

func JSON

func JSON(t time.Time) interface{}

JSON returns an interface value for a time value intended to be used when preparing a custom value for JSON encoding. It uses nil for zero time values.

func MicroTime

func MicroTime(ts int64) time.Time

ToTime coverts a microsecond resolution timestamp into a time.Time value.

func MustParse

func MustParse(s string) time.Time

MustParse parses the passed time string or panics.

func Norm

func Norm(t time.Time) time.Time

Norm takes a time and normalizes it to microsecond resolution.

func Parse

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

Parse parses a string into a time value. The string may represent an absolute time, duration relative to the current time, or a microsecond-resolution timestamp. All times are converted to UTC.

func TimeMicro

func TimeMicro(t time.Time) int64

fromTime converts a time.Time value in a microsecond resolution timestamp.

Types

This section is empty.

Jump to

Keyboard shortcuts

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