excitement-engineer / graphql-iso-date

A set of RFC 3339 compliant date/time GraphQL scalar types.
MIT License
523 stars 50 forks source link

Why does library discard UTC offsets? #112

Open zachheine opened 4 years ago

zachheine commented 4 years ago

Where an RFC 3339 compliant date-time string has a time-zone other than UTC, it is shifted to UTC. For example, the date-time string "2016-01-01T14:10:20+01:00" is shifted to "2016-01-01T13:10:20Z".

Would there be consideration to add a type that allows offsets?

Jiia commented 4 years ago

+1 because of this limitation you need a separate field to transmit the timezone info if you want to display the date in some specific timezone. UTC offsets are part of the RFC 3339 spec so there's no reason not to support it.

offero commented 4 years ago

I can see the case for both normalization and for wanting to communicate dates in their native timezones to applications. Maybe this calls for 2 types?

mormahr commented 4 years ago

This causes problems for me because the Date 2020-01-01T00:00+01:00 is serialized as 2019-12-31 which is probably not what you'd expect.

thomasstep commented 4 years ago

+1 I would like to be able to allow offsets.