title: Time travel and time freezing in Elixir
body: <p>When writing integration tests that depend on the current date/time, it is very handy to be able to <code>freeze</code> or <code>travel</code> to specific moment (like e.g. <a href="https://github.com/travisjeffery/timecop">timecop</a> for ruby)</p>
  
  <p>Is there a way to achieve something similar in Elixir/Erlang?</p>
  
  <p>I tried mocking Erlang built-ins <code>:os.timestamp</code>, <code>:erlang.universaltime</code> using <code>meck</code> library, however it fails with <code>:cannot_mock_builtin</code>.</p>
  
  <p>In principle I could implement my own utility library than would enable easy mocking of current time and then use it everywhere instead of built-in methods; however, some libraries use built-ins, so this is not a viable option (e.g <code>Ecto.Model.Timestamps</code>, generating <code>inserted_at</code> and <code>updated_at</code> values)</p>