Today I Learned

A Hashrocket project

Ready to join Hashrocket? Find Openings here and apply today.

Calculate hours, minutes, seconds in milliseconds

Erlang has timer module that makes it easy to calculate milliseconds in Elixir:

iex(1)> :timer.seconds(15)
15000
iex(2)> :timer.minutes(20)
1200000
iex(3)> :timer.hours(2)
7200000
Looking for help? At Hashrocket, we 💜 Elixir! From our many Elixir client projects, to sponsoring the Chicago Elixir Meetup, to the source code for this application, we are invested in this community. Contact us today to talk about your Elixir project.