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.11section 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.
functionproduced by · A function is a callable program unit that performs an operation, may accept inputs, and can produce a result or side effect.
Mapused by · A map is an associative data structure that stores key-value pairs and supports retrieving values by key.
java.util.Dateequivalent to · java.util.Date is a legacy, mutable Java class representing an instant in time as a millisecond-based value.
datecontrasts with · A date is a calendar value identifying a particular day.
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.