I made the white background input box. It is not part of theToggle night mode. Toggle night mode is changing only the color of the main content, sidebar is unchanged. Try it for yourself, if you donât believe me
I donât see any, which is why I always use it. timestamptz is the postgres type, utc_datetime_usec is the corresponding ecto type which maps to the DateTime elixir type.
Please use the search facilities of this forum, just a search for timestamptz returns several topics that have details about this.
The reason why Ectoâs timestamps() are naive by default is backwards compatibility. Back when Ecto was created, Elixir didnât even have datetime types and Ecto didnât have timezone support.
Also quoting my earlier answer in an earlier topic:
BTW, if you need to store the timezone too (in PostgreSQL), you have no option but to use a naive datetime field and store the offset or timezone information separately. This is because PostgreSQL does not have a data type for storing a timestamp with timezone.
There is the confusingly named timestamp with timezone but all it does is convert your input timestamp to UTC and convert it back to whatever your DB connectionâs timezone is when reading. It does not even store the offset/timezone. So you need to do that yourself somehow.
Personally I donât find much use in timestamptz, but thatâs up to everyone to decide for themselves. Itâs easy to override this in your migrations. In your schema you would use something like timestamps(type: :utc_datetime) and in migration timestamps(type: :timestamptz).
If youâre using just Elixir and your application is the only one connecting to the database, then it doesnât make a difference if you use timestamp or timestamptz. If you use other applications to also connect to the same database, timestamptz will have different implications.