Ecto.Time
An Ecto type for time.
Summary
| cast(t) | Casts the given value to time |
| compare(t1, t2) | Compare two times |
| dump(arg1) | Converts an |
| from_erl(arg) | Returns an |
| load(time) | Converts a time tuple like the one returned by |
| local() | Returns an |
| to_erl(time) | Returns an Erlang time tuple from an |
| to_iso8601(time) | Converts |
| to_string(time) | Converts |
| type() | The Ecto primitive type |
| utc() | Returns an |
Functions
Casts the given value to time.
It supports:
- a binary in the “HH:MM:DD” format
(may be followed by “Z”, as in
12:00:00Z) - a binary in the “HH:MM:DD.USEC” format
(may be followed by “Z”, as in
12:00:00.005Z) - a map with
"hour","min"keys with"sec"and"usec"as optional keys and values are integers or binaries - a map with
:hour,:minkeys with:secand:usecas optional keys and values are integers or binaries - a tuple with
{hour, min, sec}as integers or binaries - a tuple with
{hour, min, sec, usec}as integers or binaries - an
Ecto.Timestruct itself
Compare two times.
Receives two times and compares the t1
against t2 and returns :lt, :eq or :gt.
Converts an Ecto.Time into a time tuple (in the form `{hour, min, sec,
usec}`).
Returns an Ecto.Time from an Erlang time tuple.
Converts a time tuple like the one returned by dump/1 into an Ecto.Time.
Returns an Ecto.Time in local time.
Returns an Erlang time tuple from an Ecto.Time.
Converts Ecto.Time to its ISO 8601 UTC representation.
Converts Ecto.Time to a string representation.
The Ecto primitive type.
Returns an Ecto.Time in UTC.