Open pragyanaryal opened 3 years ago
You could use the pgtype.Time
type for the PostgreSQL time
type.
You can probably use it for time with time zone
as well, but I wouldn't recommend it. The official PostgreSQL docs recommend against using that type at all (https://www.postgresql.org/docs/current/datatype-datetime.html).
The type time with time zone is defined by the SQL standard, but the definition exhibits properties which lead to questionable usefulness. In most cases, a combination of date, time, timestamp without time zone, and timestamp with time zone should provide a complete range of date/time functionality required by any application.
Thanks. Hello, I did a small hack to store time as I needed, I formatted the time in 5:45:00+541
format, which is a string. Pgx, successfully inserted the data, and my db readily approved the format. Now upon fetching the data it cannot parse the time, any more. Any idea or suggestion on it ?
What are you trying to scan it into? I would expect you could scan it into a string
.
Hello, I am having trouble implementing time with time zone without date postgres type. I could only see time or timestamp or timestampz implementation and think it is not what i need. Can anyone help me with this ? I have a time of day in a for a certain time zone, that I need to store in postgres. This is what I am trying to insert inside db,
But, db throws an error stating date/field out of range.
What correction should I make ?