Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to store and retrieve timezoned dates #4

Open
obsidienne opened this issue Sep 20, 2022 · 2 comments
Open

Add a way to store and retrieve timezoned dates #4

obsidienne opened this issue Sep 20, 2022 · 2 comments
Labels
question Further information is requested

Comments

@obsidienne
Copy link

Hi,

I need to store and retrieve date for upcoming events (start datetime and end datetime).

I will use tz and tzdata for the timezone handling but the datetime storage/retrieve is missing to complete the use case.

Do you have any advice ?

Thanks.

@mathieuprog
Copy link
Owner

I would advice to store the date times NOT in UTC, but in the time zone of the event. So in the database you would have the datetime and time zone identifier.

But I guess that doesn't really answer your question. I'm not sure what you want me to advice. The store data in DB we use Ecto. You just need to add the date and time zone fields in your db table.

@mathieuprog mathieuprog added the question Further information is requested label Sep 20, 2022
@obsidienne
Copy link
Author

A friend just told me about the hex package tz_datetime. This lib adds convenience functions to store and retrieve datetime with timezone.

Could be something interesting to add to your lib.

Thanks for your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants