bitwalker / bitwalker/timex_ecto

How to store date/time as UTC but retrieve as localized date/time?

Open
#63 6 comments 3 reactions 0 assignees View on GitHub
question
Dominant language
Elixir
Stars
162
Forks
68
PR merge metrics
No merged PRs in 30d

Description

Hi,

I was looking for a solution that will store my datetimes in UTC but on Application side will be in IST.
I have followed the guide and added `use Timex.Ecto.Timestamps` into my ` def model do` in `web.ex`.

Now querying the Repo I get updated_at and inserted_at as `#`. Is there a way I can set some kind of config to serialize the datetime as IST. Also when I will insert I want to give IST to the changeset and it be properly converted and set in DB to UTC.

Going through the docs was not sufficient to find a solution to this problem.

I will create a MR to update docs if any solution such problem exists.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.