Skip to main content

daysFromNow()

Returns a localized date that is a specified number of days away.

Usage

import { daysFromNow } from 'easy-dates';

daysFromNow(multiplier, locale)

Prop types

proptyperequireddefault
multipliernumberyesnull
localestringno'en-CA'

Examples

one day from now - defaults to Canadian English
daysFromNow(1) // Tue Mar 22 2022 00:08:07 GMT-0400 (Eastern Daylight Time)
one day from now - United Kingdom Enlighs
daysFromNow(1, 'en-UK') // '22/03/2022, 00:08:57'
42 days from now - United States English
daysFromNow(42, 'en-US') // '5/2/2022, 12:09:45 AM'