dateconv

1.0.4 • Public • Published

About

Converts unixtime into required format depending on masks. Default language russion, but can be changed in i18n.js file.

Install

npm i dateconv

Usage

const dateconv = require('dateconv');
 
let unix = Date.now();
let mask = '{yyyy}/{mm}{dd} {HH}:{MM}';
 
let date = dateconv(unix, mask);
 
console.log(date); // 2019/10/03 08:35

Masks

Possible masks options and example of result.

'{dddd}'  // четверг
'{ddd}'   // чт
'{dd}'    // 03
'{d}'     // 3

'{mmmm}'  // октября
'{mmm}'   // окт
'{mm}'    // 10
'{m}'     // 10

'{yyyy}'  // 2019
'{yy}'    // 19

'{HH}'    // 08
'{H}'     // 8

'{MM}'    // 35
'{M}'     // 35

'{SS}'    // 09
'{S}'     // 9

'{LLL}'   // 042
'{L}'     // 42

Package Sidebar

Install

npm i dateconv

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

3.54 kB

Total Files

5

Last publish

Collaborators

  • hollonify