Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

⏲ Millisecond Durations with Luxon

node v10.24.1
version: 1.0.0
endpointsharetweet
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