Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
⏲ Millisecond Durations with Luxon
node v10.24.1
version:
1.0.0
endpoint
share
tweet
Often, configuration data that is represented as a time span will be stored as milliseconds. It's suprising how long it can take to understand a simple calculation, so why not let luxon make the conversion more readable?
const { Duration } = require("luxon") 1000 * 60 * 30 === Duration.fromObject({ minutes: 30 }).as("milliseconds") 1000 * 60 * 60 * 24 * 30 === Duration.fromObject({ days: 30 }).as("milliseconds")
Loading…
no comments
sign in
to comment