/plushcap/analysis/hasura/postgres-date-time-data-types-on-graphql-fd926e86ee87

Postgres Date/Time types on GraphQL

What's this blog post about?

Postgres supports a variety of date and time types, offering flexibility in storing time/date data. This blog post discusses using these date-time types in GraphQL with the Hasura GraphQL Engine (HGE). HGE supports implicit timestamp types as strings in queries or custom scalars like Timetz and Timestamptz for properly formatted ISO-8601 values. It also allows creating columns with default timestamp values at creation. The timestamptz field stores the normalized UTC time, making it timezone independent and accurate across different locations and time zones. Querying date/time types involves representing them as ISO-8601 formatted strings. Inserting into Timestamptz fields is straightforward with timestamps as strings or just dates or timestamps without time zones.

Company
Hasura

Date published
Aug. 17, 2018

Author(s)
Hasura

Word count
626

Language
English

Hacker News points
None found.


By Matt Makai. 2021-2024.