lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
9.04k stars 909 forks source link

Issue Parsing a timestamp string outputed by the formatter based on a UTC +00 time.Date #1072

Closed stephanvanzwienen closed 2 years ago

stephanvanzwienen commented 2 years ago

When 'FormatTimestamp' receives an time.Date with an offset of 0 , it outputs an timestamp string that looks like this "2001-02-03 04:05:06.123456789Z". Ending with a 'Z' timezone separator char.

I expect that when passing that timestamp string to the ParseTimestamp function will return the same time.Date as we gave to FormatTimestamp func.

But currently the parseTimestamp function returns the following error expected end of input, got Z. This shouldn't be the case as the "2001-02-03 04:05:06.123456789Z" is a valid timestampstring.

cyx commented 2 years ago

@stephanvanzwienen we can close this correct?

stephanvanzwienen commented 2 years ago

@cyx yes this issue can be closed as my pull request has been accepted and merged :)