kalkatfyodor
But instead using native_datetime and timestamp.
I have searched the Internet and the overwhelming majority is saying that timestamp should NOT be used and instead one should use timestamptz.
So why does Phoenix use native_datetime and timestamp?
Sources:
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
krstfk
timestampsJust in case you missed it, there’s a search box on the top left of all elixir documentation.
dodo
No idea, I always use
timestamptz.In migrations:
timestamps(type: :timestamptz)In schemas:
timestamps(type: :utc_datetime_usec)kalkatfyodor
What are some downsides of using timestamptz or utc_datetime_usec?
kalkatfyodor
Thanks. I haven’t noticed. It’s too dark. They should make the input box with white background.
Current state:
VS
My proposal:
cmo
Are you aware that there is a search box on this forum too, and one of the Google homepage?
You can change hexdocs to light theme at the bottom of the page.
kalkatfyodor
I made the white background input box. It is not part of the
Toggle 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 meal2o3cr
One of the answers in that linked StackOverflow post points to an official Postgres FAQ that has a decent-sounding reason:
(in response to "Don’t use timestamp without TZ to store UTC"):
Ecto already converts values to UTC, and needs to support other databases that don’t have
timestamp with time zone.dodo
I don’t see any, which is why I always use it.
timestamptzis the postgres type,utc_datetime_usecis the corresponding ecto type which maps to theDateTimeelixir type.Nicd
Please use the search facilities of this forum, just a search for
timestamptzreturns 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:
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 liketimestamps(type: :utc_datetime)and in migrationtimestamps(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
timestamportimestamptz. If you use other applications to also connect to the same database,timestamptzwill have different implications.