Skip to main content


After installing easy-dates, using it is as simple as importing (or requiring) the function at the top of your project or component file.

ES Modules

import { dateNow } from 'easy-dates';

Then you can use it normally, like you would any other function. Here's a React.js example.

import React from 'react';
import { dateNow } from "easy-dates";

function MyComponent() {
return (

Check out a live ESM demo of this function, and others on StackBlitz.

Open easy-dates demo in StackBlitz


const { dateNow } = require('easy-dates');

const todaysDate = dateNow('en-CA');


In the example above, the dateNow() function takes in a single argument (the en-CA locale), and returns the current date, in the specified locale. In the example, the return value would look something like 2022-03-17, 11:50:09 p.m.

Check out a live CommonJS demo of this function, and others on StackBlitz below.

Open easy-dates demo in StackBlitz