Documentation ¶
Index ¶
Constants ¶
const ( RFC3339DateNano = "2006-01-02T15:04:05.999999999" RFC3339DateNanoSpace = "2006-01-02 15:04:05.999999999" RFC3339DateNanoZSpace = "2006-01-02 15:04:05.999999999Z07:00" RFC3339DateSec = "2006-01-02T15:04:05" RFC3339DateSecZ = "2006-01-02T15:04:05Z07:00" RFC3339DateSecSpace = "2006-01-02 15:04:05" RFC3339DateSecZSpace = "2006-01-02 15:04:05Z07:00" RFC3339DateMin = "2006-01-02T15:04" RFC3339DateMinZ = "2006-01-02T15:04Z07:00" RFC3339DateMinSpace = "2006-01-02 15:04" RFC3339DateMinZSpace = "2006-01-02 15:04Z07:00" RFC3339DateHour = "2006-01-02T15" RFC3339DateHourZ = "2006-01-02T15Z07:00" RFC3339DateHourSpace = "2006-01-02 15" RFC3339DateHourZSpace = "2006-01-02 15Z07:00" RFC3339DateOnly = "2006-01-02" RFC3339DateOnlyZ = "2006-01-02Z07:00" )
The following format is used to parse the abbreviated form of RFC3339 date-time.
const RFC3339DateTimeFormat string = "2006-01-02T15:04:05.999-07:00"
Format string for date-time in RFC3339, disallowing Z as time-offset.
Use it to stringify time.Time forcing timezone offset not to use "Z".
const RFC3339DateTimeFormatZ string = time.RFC3339Nano
Format string for date-time in RFC3339, allowing Z as time-offset.
Use it to parse RFC3339 date-time expression.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RFC3339 ¶
date-time in https://www.ietf.org/rfc/rfc3339.txt . this is known as a subset of ISO8601 extended format.
This type is useful to interchange timestamps via network/file.
func ParseLooseRFC3339 ¶
When you need to parse string with the abbreviated forms of RFC3339 date-time, use this function.
func (RFC3339) Equiv ¶
return true if this and other `.Time()` are equal. If both this and other are nil, also return true.
otherwise, return false.
func (RFC3339) MarshalJSON ¶
implement encoding/json.Marshaller
func (RFC3339) String ¶
get string expression.
It formatted by RFC3339DateTimeFormat.
When you need other format, use
func (*RFC3339) UnmarshalJSON ¶
implement encoding/json.Unmarshaller