You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thank you for starting this project — I think it's something the GraphQL community definitely needs to have.
I'd like to propose a tweak: make DateTime be timezone-agnostic (i.e. unaware of its UTC offset), and introduce a DateTimeTz scalar type that requires a UTC offset to be specified. This is the change that the GraphQL compiler project settled on after long discussions on the topic, and we wrote up our proposed definition for DateTimeTz here: kensho-technologies/graphql-compiler#829
Some of our considerations:
Some programming languages (e.g. Python) do not require UTC offset / timezone information to be set on datetimes, and DateTimeTz as a name is more explicit about this requirement.
Some query languages (e.g. SQL) default to not carrying UTC offset / timezone information unless specifically mentioned in the name of the type. For example, in the SQL standard, timestamp is equivalent to timestamp without time zone, and to get time zone info, you must use the type timestamp with time zone or an abbreviation like timestamptz: https://www.postgresql.org/docs/current/datatype-datetime.html
Because of the above, we were concerned about potential confusion — users used to SQL and/or Python may incorrectly assume that DateTime either explicitly does not contain time zone info (a la SQL), or is allowed but not required to contain it (a la Python). Being explicit about the existence of a scalar DateTimeTz type immediately allows the user to set correct expectations about scalar DateTime as well.
The text was updated successfully, but these errors were encountered:
I agree that DateTime is not a perfect name, but I want to point out that this is the name of the spec and not necessarily the name of the Scalar. The Scalar can be named how ever people want.
The GraphQL community uses mostly DateTime which represent a RFC3339/ISO 8601 formatted value with offset, this is why the name DateTime what chosen.
I think we will add more Date related scalars, namely LocalDateTime (again: the name of the spec, not the name of the Scalar) which will represent a date time without offset or time zone.
First, thank you for starting this project — I think it's something the GraphQL community definitely needs to have.
I'd like to propose a tweak: make
DateTime
be timezone-agnostic (i.e. unaware of its UTC offset), and introduce aDateTimeTz
scalar type that requires a UTC offset to be specified. This is the change that the GraphQL compiler project settled on after long discussions on the topic, and we wrote up our proposed definition forDateTimeTz
here: kensho-technologies/graphql-compiler#829Some of our considerations:
DateTimeTz
as a name is more explicit about this requirement.timestamp
is equivalent totimestamp without time zone
, and to get time zone info, you must use the typetimestamp with time zone
or an abbreviation liketimestamptz
: https://www.postgresql.org/docs/current/datatype-datetime.htmlDateTime
either explicitly does not contain time zone info (a la SQL), or is allowed but not required to contain it (a la Python). Being explicit about the existence of ascalar DateTimeTz
type immediately allows the user to set correct expectations aboutscalar DateTime
as well.The text was updated successfully, but these errors were encountered: