Skip to content

ParseTimestamp will not parse input from FormatTimestamp #606

@samuelkaufman

Description

@samuelkaufman

Hi,
I just submitted https://github.com/lib/pq/pull/605/files.
Basically I expected ParseTimestamp to be able to parse what FormatTimestamp produces, but it errors instead. I didn't have the time/skill offhand to see what the error is actually referring to but I committed a failing test case.

Use case here is I've got a row with an expire date that can be infinity, as I kind of felt a zero value would be the wrong abstraction, being that you'd expect setting a date to 1970 would mean it is expired, not that it never expires.

So I am manually calling Format and Parse rather than letting lib/pq do its thing, which led me to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions