Open klondikedragon opened 2 years ago
It also looks like it doesn't properly recognize time zones like PMDT, PMST, and AMT where the time zone name shares the same prefix as PM/AM. (e.g., 2018-09-30 21:09:09 PMDT
or 2018-09-30 21:09:09 PM PMDT
or 2018-09-30 21:09:09 PM AMT
). It looks like when it hits the first P
it goes into the timeWsAMPMMaybe
state, but then when it hits the M
it thinks that it is definitely an AM/PM. At that point it could potentially 'look ahead' at the next rune and if it isn't the end and it's still an alpha character then assume it's a time zone, etc.
https://github.com/araddon/dateparse/blob/master/parseany.go#L1397
This is a very helpful package, thank you!
Parsing
2018-09-30 09:09:09PM EST
will produce a correct result (the same as2018-10-01T01:09:09Z
), but2018-09-30 09:09:09 PM EST
will be incorrect (it recognizes thePM
but not the time zone -- it produces the time value of2018-09-30T21:09:09Z
).