# `Tempo.Clock`
[🔗](https://github.com/elixir-tempo/tempo/blob/v2.1.0/lib/tempo/clock.ex#L1)

A behaviour that gives Tempo the current time.

`Tempo.utc_now/0`, `Tempo.now/1`, `Tempo.utc_today/0` and `Tempo.today/1`
ask the clock configured under `:ex_tempo, :clock`, which by default is
`Tempo.Clock.System` and answers with `DateTime.utc_now/0`. A test pins
the time of its own process with `Tempo.Clock.Test.put/1`, which leaves
concurrent tests their own.

# `utc_now`

```elixir
@callback utc_now() :: DateTime.t()
```

The current time as a `t:DateTime.t/0` in `Etc/UTC`.

# `clock`

```elixir
@spec clock() :: module()
```

The clock in use: the calling process's, else the application's, else
`Tempo.Clock.System`.

### Returns

* The module of the clock in use, one that implements `Tempo.Clock`.

### Examples

    iex> Tempo.Clock.clock()
    Tempo.Clock.System

---

*Consult [api-reference.md](api-reference.md) for complete listing*
