liveBook · Manning

Time

As explained in Elixir in Action, Third Edition

Time is the Elixir standard-library type and module for representing times of day with subsecond precision.

Time is an Elixir standard-library abstraction for representing a time of day with subsecond precision. It belongs to Elixir’s higher-level types, alongside Date, NaiveDateTime, and DateTime, and exposes fields such as hour and minute. section 2.4.11 section 2.8

iex(1)> time = ~T[11:59:12.00007]

iex(2)> time.hour
11

iex(3)> time.minute
59

Inspect a subsecond time literal and access its hour and minute fields. section 2.4.11

How Elixir in Action, Third Edition covers it

How deep it goes
Defines the abstraction and demonstrates literal construction plus field access, without detailing operations or internals.
Examples
Uses the ~T time literal with subsecond precision and reads hour and minute fields.
What you can do after
Evaluate/understand time literals and inspect their hour and minute components.
How it connects
Relates Time to Date, NaiveDateTime, DateTime, and Elixir’s underlying built-in types.

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.