Skip to content
Simple library to work with milliseconds
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.gitignore
README.md
mix.exs

README.md

Millseconds for Elixir

Convert the word version of time to milliseconds and vice-versa.

Examples

import Milliseconds

# Milliseconds to readable time
convert(3600000)
  # => "1h"

# Readable time to milliseconds
convert("2yrs")
  # => 6.31152e10

# Calculate future time

# Milliseconds 24 hours from now
expires_tomorrow = future_time("24hrs")

# Milliseconds 6 hrs from now
expires_later = future_time("6hrs")

# Current time in milliseconds
now = current_time_millis

Inspired by ms.js: https://github.com/rauchg/ms.js

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.