tjmehta / graphql-date

GraphQL Date Type
MIT License
67 stars 11 forks source link

Date format across different timezones #16

Closed LluisArevalo closed 7 years ago

LluisArevalo commented 7 years ago

We are using graphql-date package to fetch data from our API and send it in to our front-end. The problem is that the date is wrong in some timezones.

We have this date in the database: 2018-04-24 02:00:00.000. While in Spain the date is 24th April, in Miami or Mexico it appears as 23rd April.

I'm not sure if it's an issue in the package or what's going on.

Thanks!

tjmehta commented 7 years ago

This package should not be converting dates. It uses new Date to convert numbers and strings to dates. So make sure you are passing the right dates in. Your DB may be writing GMT dates if you are just passing a date instance.

LluisArevalo commented 7 years ago

Thanks for answering @tjmehta :)