Change Timestamps

Learn how to change default options for timestamps.

Change defaults for timestamps

Earlier, we saw how the timestamps method automatically adds inserted_at and updated_at columns to our tables. By default, these will always use Elixir’s NaiveDateTime type, but we’ll can change this globally in our Repo config. Here’s how we could change it to use a UTC timestamp.

Get hands-on with 1400+ tech skills courses.