You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

dateconv

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dateconv

Converts unixtime into required format depending on masks

1.0.4
latest
npmnpm
Version published
Weekly downloads
1
-75%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

date

FAQs

Package last updated on 30 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts