@amanda-hg/date-formats

An awesome module that retrieves a date with whatever format you give it

Usage no npm install needed!

<script type="module">
  import amandaHgDateFormats from 'https://cdn.skypack.dev/@amanda-hg/date-formats';
</script>

README

date-formats

This module returns a date format. You can write the format you want and it returns the date.

Usage

Just require the module like any other npm module

const date = require('date-formats');

Methods

This module has one method:

  • format: returns a date with the format date which one the user pass by param.

Example

format

Input:

const date = require('date-formats');

const dateFormat1 = date.format('DD-MM-YYYY');
console.log(dateFormat1);

const dateFormat2 = date.format('YYYY/MM/DD');
console.log(dateFormat2);

Output:

01-11-1999

1999/11/01