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

pq: invalid array literal. #1156

Open
wnesbv opened this issue Apr 4, 2024 · 0 comments
Open

pq: invalid array literal. #1156

wnesbv opened this issue Apr 4, 2024 · 0 comments

Comments

@wnesbv
Copy link

wnesbv commented Apr 4, 2024

in the postgres database
{"2024-04-05 00:00:00","2024-04-10 00:00:00"}
`

func qSchBkg(w http.ResponseWriter, conn *sql.DB,start time.Time,end time.Time) (rows *sql.Rows, err error) {

    fmt.Println("qSchBkg start.. ", start)

    // start,end print 2024-04-05 00:00:00 +0000 UTC 2024-04-10 00:00:00 +0000 UTC

    rows,err = conn.Query("SELECT * FROM booking WHERE days_booking BETWEEN $1 AND $2", start,end)

    if err != nil {
        switch {
            case true:
            fmt.Fprintf(w, "Error: Query()..! : %+v\n", err)
            break
        }
        return
    }
    return rows,err
}

`
Error: Query()..! : pq: invalid array literal: "2024-04-05 00:00:00Z"

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

1 participant