Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20/5/2006 19:51:45 produces an error month out of range #105

Open
asannikov opened this issue Jun 17, 2020 · 1 comment
Open

20/5/2006 19:51:45 produces an error month out of range #105

asannikov opened this issue Jun 17, 2020 · 1 comment

Comments

@asannikov
Copy link
Contributor

I added test case:
{in: "20/5/2006 19:51:45", out: "2006-05-20 19:51:45 +0000 UTC"},
and it's failed with an error:

❯ go test -cover
--- FAIL: TestParse (0.00s)
panic: parsing time "20/5/2006 19:51:45": month out of range [recovered]
        panic: parsing time "20/5/2006 19:51:45": month out of range

goroutine 20 [running]:
testing.tRunner.func1.1(0x12d1680, 0xc000099000)
        /usr/local/go/src/testing/testing.go:941 +0x3d0
testing.tRunner.func1(0xc0000d0900)
        /usr/local/go/src/testing/testing.go:944 +0x3f9
panic(0x12d1680, 0xc000099000)
        /usr/local/go/src/runtime/panic.go:967 +0x166
..../golang/dateparse.MustParse(0x1343561, 0x12, 0x0, 0x0, 0x12e3d20)
..../golang/dateparse/parseany.go:177 +0xfe
..../golang/dateparse.TestParse(0xc0000d0900)
..../golang/dateparse/parseany_test.go:60 +0xb10
testing.tRunner(0xc0000d0900, 0x1357e08)
        /usr/local/go/src/testing/testing.go:992 +0xdc
created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:1043 +0x357
exit status 2
FAIL    ..../golang/dateparse        0.350s
@troyspencer
Copy link
Contributor

This is fixed in #89 by setting the retryAmbiguousDateWithSwap ParserOption to true

klondikedragon added a commit to itlightning/dateparse that referenced this issue Dec 12, 2023
Incorporates PR araddon#133 from https://github.com/mehanizm to fix araddon#129

Adds test cases to verify the following are already fixed:
* araddon#105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants