dateconv
v1.0.4
Published
Converts unixtime into required format depending on masks
Downloads
16
Readme
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