Documentation
¶
Index ¶
Constants ¶
View Source
const ( // YearMonthDay is a time format similar to RFC3339 with day granularity // instead of second. YearMonthDay = "2006-01-02" // YearMonthDayHour is a time format similar to RFC3339 with hour // granularity instead of second. YearMonthDayHour = "2006-01-02T15Z07:00" // YearMonthDayHourMinute is a time format similar to RFC3339 with minute // granularity instead of second. YearMonthDayHourMinute = "2006-01-02T15:04Z07:00" // RFC3339Milli is a time format layout for use in time.Format and // time.Parse. It follows the RFC3339 format with millisecond precision. RFC3339Milli = "2006-01-02T15:04:05.999Z07:00" // RFC3339Micro is a time format layout for use in time.Format and // time.Parse. It follows the RFC3339 format with microsecond precision. RFC3339Micro = "2006-01-02T15:04:05.999999Z07:00" )
Variables ¶
View Source
var FormatNames = []string{
"YearMonthDay",
"YearMonthDayHour",
"YearMonthDayHourMinute",
"StampMilli",
"RFC3339",
"RFC3339Milli",
"RFC3339Micro",
"RFC3339Nano",
"RFC1123Z",
}
FormatNames are the valid time format names accepted by this package.
View Source
var ( // Now is a hijackable function for time.Now() that makes unit testing a lot // easier for stuff that relies on relative time. Now = time.Now )
Functions ¶
func FormatNameToLayout ¶
FormatNameToLayout returns the time format layout for the time format name.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.