New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

date-templates

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-templates

Simple date templates and date generator

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
14
-44%
Maintainers
1
Weekly downloads
 
Created
Source

date-templates

Some templates for Dates like the Date in one hour or at midnight The methods should be pretty selfexplaining if you have codecompletion in you IDE, but here are some examples:

const dates = require('date-templates')

console.log(dates.format(dates.now())) // Get current Date and format it
console.log(dates.format(dates.in(1000))) // Get Date in 1000ms and format it
console.log(dates.format(dates.in(dates.seconds(2)))) // Get Date in 2 seconds and format it
console.log(dates.format(dates.midnight())) // Get Date at midnight and format it

console.log(dates.formatCustom(dates.now(), 'DD/MM/YYYY HH:mm:ss')) // Get current Date and format it using a custom template
console.log(dates.format(dates.tomorrow(dates.at('15:00:00')))) // Get Date tomorrow at 15:00:00 and format it

Keywords

date

FAQs

Package last updated on 27 Mar 2022

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