Documentation ¶
Overview ¶
Package times provides a set of utilities related to processing time.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClock = &defaultClock{}
DefaultClock implements Clock by delegating to methods in package time.
Functions ¶
func ParseIso8601UTC ¶
ParseIso8601UTC parses a time in Iso8601 format and UTC timezone (yyyy-MM-ddTHH:mm:ss.fffZ).
func ParseIsoDashUTC ¶
ParseIsoDashUTC parses a time in IsoDash format and UTC timezone (yyyy-MM-ddTHH-mm-ss.fffZ).
func ToIso8601UTC ¶
ToIso8601UTC converts a time into a string in Iso8601 format in UTC timezone (yyyy-MM-ddTHH:mm:ss.fffZ).
Example ¶
fmt.Println(ToIso8601UTC(time.Date(2015, 6, 30, 0, 29, 4, 569000000, time.UTC)))
Output: 2015-06-30T00:29:04.569Z
Example (Locale) ¶
mst := time.FixedZone("MST", -7*3600) // seven hours west of UTC fmt.Println(ToIso8601UTC(time.Date(2015, 6, 3, 0, 9, 4, 569100000, mst)))
Output: 2015-06-03T07:09:04.569Z
Types ¶
Click to show internal directories.
Click to hide internal directories.