Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
KnownFormats = []string{
"MMM D, YYYY h:mm:ss P",
"DDD MMM _D HH:mm:ss YYYY",
"DDD MMM _D HH:mm:ss MST YYYY",
"DDD MMM DD HH:mm:ss ZZZZ YYYY",
"DDDD, YY-MMM-DD HH:mm:ss ZZZ",
"DDD, DD MMM YYYY HH:mm:ss ZZZ",
"DDD, DD MMM YYYY HH:mm:ss ZZZZ",
"DDD, D MMM YYYY HH:mm:ss ZZZZ",
"DD MMM YYYY, HH:mm",
"YYYY-MMM-DD",
"DD MMMM YYYY",
"DD/MM/YYYY HH:mm:ss.SSS",
"DD/MM/YYYY HH:mm:ss",
"D/MM/YYYY HH:mm:ss",
"DD/M/YYYY HH:mm:ss",
"D/M/YYYY HH:mm:ss",
"D/M/YYYY hh:mm:ss P",
"DD/MM/YYYY HH:mm",
"D/M/YYYY HH:mm",
"D/M/YY HH:mm",
"D/M/YYYY hh:mm P",
"D/M/YYYY h:mm P",
"DD/MMM/YYYY:HH:mm:ss ZZZZ",
"DD/MM/YYYY",
"D/MM/YYYY",
"DD/MM/YY",
"D/M/YY",
"YYYY/MM/DD HH:mm:ss.SSS",
"YYYY/MM/DD HH:mm:ss",
"YYYY/MM/D HH:mm:ss",
"YYYY/M/DD HH:mm:ss",
"YYYY/MM/DD HH:mm",
"YYYY/M/D HH:mm",
"YYYY/MM/DD",
"YYYY/M/DD",
"YYYY-MM-DDTHH:mm:ss.SSSZZZZZ",
"YYYY-MM-DDTHH:mm:ss.SSSZZZZ",
"YYYY-MM-DDTHH:mm:ss.SSSZ",
"YYYY-MM-DDTHH:mm:ssZZZZZ",
"YYYY-MM-DDTHH:mm:ssZZZZ",
"YYYY-MM-DDTHH:mm:ssZ",
"YYYY-MM-DDTHH:mm:ss",
"YYYY-MM-DD HH:mm:ss.SSS ZZZZ ZZZ",
"YYYY-MM-DD HH:mm:ss.SSS",
"YYYY-MM-DD HH:mm:ss ZZZZZ",
"YYYY-MM-DD HH:mm:ssZZZZZ",
"YYYY-MM-DD HH:mm:ss ZZZZ ZZZ",
"YYYY-MM-DD HH:mm:ss ZZZZ",
"YYYY-MM-DD HH:mm:ss ZZZ",
"YYYY-MM-DD hh:mm:ss P",
"YYYY-MM-DD HH:mm:ss",
"YYYY-MM-DD HH:mm:ss",
"YYYY-MM-DD HH:mm",
"YYYY-MM-DD",
"MM.DD.YYYY",
"MM.DD.YY",
"DDD MMM _D HH:mm:ss.SSS",
"DDD MMM DD HH:mm:ss.SSS",
"MMM DD HH:mm:ss",
"MMM _D HH:mm:ss",
}
)
Functions ¶
func NewDefaultParser ¶
func NewDefaultParser(usrFmts ...string) *parser
NewDefaultParser creates new default parser using either known formats or the formats provided
Types ¶
type Parser ¶
Parser parses the given byte slice in accordance with the date formats it has, returns parsed out date (leftmost only) and format which can be used to parse similarly formatted dates. In case if no suitable format can be found empty time.Time object is returned.
NOTE: Since date portion search in the given slice is based on regexp it can consume considerable amount of CPU cycles (depends on the number of formats the current parser has).
Click to show internal directories.
Click to hide internal directories.