Cannot parse `2015-06-10 00:00:00 GMT+02:00`
Revision: 21df004e09ca46e07ce99bbba1e8c2422ba4ecf9
Example link: https://www.e-marketing.fr/Thematique/social-media-1096/Breves/Banque-Postale-mise-marketing-temps-reel-impression-255997.htm#WQ17awvif7mWRLVy.97
Test Case
func TestDateParse(t *testing.T) {
_, err := dateparse.ParseAny("2015-06-10 00:00:00 GMT+02:00")
assert.NoError(t, err)
}
Result
Error Trace: date_extractor_test.go:80
Error: Received unexpected error:
parsing time "2015-06-10 00:00:00 GMT+02:00" as "2006-01-02 15:04:05 MST-07000": cannot parse ":00" as "-0700"
Test: TestDateParse
Do you mind clarifying for me is the "2015-06-10" October 6th 2015 or is that June 10th 2015, just to be absolutely sure.
Hm, seems go doesn't really like that offset format (seems to not support the combo of GMT[+-]hh:mm ie with the colon?) https://play.golang.org/p/fjk2fFKNAwu
package main
import (
"fmt"
"time"
)
func main() {
t, err := time.Parse("2006-01-02 15:04:05 MST-07:00","2015-10-06 00:00:00 GMT+02:00")
fmt.Printf("1 t=%v err=%v\n\n", t, err)
}
1 t=0001-01-01 00:00:00 +0000 UTC err=parsing time "2015-10-06 00:00:00 GMT+02:00" as "2006-01-02 15:04:05 MST-07:00": cannot parse ":00" as "-07:00"
Yes, the problem is definitely in the format. :(
I think I got it in my pr: https://github.com/araddon/dateparse/pull/151