Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Precision ¶
type Precision int
Precision is the granularity of the datetime
const ( PrecisionUnknown Precision = iota // Year: YYYY (eg 1997) PrecisionYear // Year and month: YYYY-MM (eg 1997-07) PrecisionMonth // Complete date: YYYY-MM-DD (eg 1997-07-16) PrecisionDay // Complete date plus hours and minutes: YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00) PrecisionHour // Complete date plus hours, minutes and seconds: YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00) PrecisionSecond // Complete date plus hours, minutes, seconds and a decimal fraction of a second YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00) PrecisionNanosecond )
func ParsePrecision ¶
ParsePrecision detects the precision level in the provided string
type Time ¶
Time represents a W3C datetime https://www.w3.org/TR/NOTE-datetime
func NewWithPrecision ¶
New creates a Time with the specified precision
func Parse ¶
Parse parses a formatted datetime string and returns the time value/precision it represents.
func (Time) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*Time) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
Click to show internal directories.
Click to hide internal directories.