time

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDateTime

func FormatDateTime(value time.Time) string

FormatDateTime format value as a date-time (RFC3339 section 5.6)

Example: 1985-04-12T23:20:50.52Z

func FormatEpochSeconds

func FormatEpochSeconds(value time.Time) float64

FormatEpochSeconds returns value as a Unix time in seconds with with decimal precision

Example: 1515531081.1234

func FormatHTTPDate

func FormatHTTPDate(value time.Time) string

FormatHTTPDate format value as a http-date (RFC 7231#section-7.1.1.1 IMF-fixdate)

Example: Tue, 29 Apr 2014 18:30:38 GMT

func ParseDateTime

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

ParseDateTime parse a string as a date-time

Example: 1985-04-12T23:20:50.52Z

func ParseEpochSeconds

func ParseEpochSeconds(value float64) time.Time

ParseEpochSeconds returns value as a Unix time in seconds with with decimal precision

Example: 1515531081.1234

func ParseHTTPDate

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

ParseHTTPDate parse a string as a http-date

Example: Tue, 29 Apr 2014 18:30:38 GMT

Types

This section is empty.

Jump to

Keyboard shortcuts

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