liveBook · Manning

Date

As explained in Elixir in Action, Third Edition

Date is an Elixir standard-library abstraction for calendar dates without a time of day.

Date represents a calendar date without a time of day. It is a higher-level Elixir abstraction built on the language’s underlying data types. section 2.4.11 section 2.8

Construct and inspect a date

Create a date with the sigil ~D[2023-01-31], then access fields such as date.year and date.month.

How Elixir in Action, Third Edition covers it

How deep it goes
Defines Date, demonstrates literal construction, and shows field access without covering date operations or validation details.
Examples
Uses the ~D[2023-01-31] literal and accesses its year and month fields.
What it assumes
Assumes familiarity with Elixir’s underlying built-in types and introduces Date as a higher-level abstraction.
What you can do after
Evaluate/understand basic Date construction and inspect its calendar fields in IEx.
How it connects
Connects Date with Time, NaiveDateTime, and DateTime as commonly used higher-level abstractions.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elixir in Action, Third Edition. The section links point to the parts of the book it draws on.