Skip to content

Go parse time error? #27746

Closed
Closed
@Yukinoshita-Yukino

Description

@Yukinoshita-Yukino

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

The Go Playground
Code:
https://play.golang.org/p/0oIjit-r3pp

Does this issue reproduce with the latest release?

I guess so?

What operating system and processor architecture are you using (go env)?

The Go Playground
https://play.golang.org/p/0oIjit-r3pp

What did you do?

I was trying to use gogstash to parse logs, and I have some issue parsing time.
I don't have local Go env so I tried the Go Playground and seems like the problem is from Go.
The log I was trying to parse uses "YYYYMMdd-HHmmss-SSS" format for timestamp, so I tried "20060102-150405-999" and "20060102-150405-000" for time format but I got error for both of them.

What did you expect to see?

Time being parsed correctly.

What did you see instead?

parsing time "20180724-101112-111" as "20060102-150405-999": cannot parse "111" as "-999"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions