Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

timespec

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timespec

Parse time-like phrases into a Date.

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

timespec

Parse time-like phrases into a javascript Date.

Inspired by the unix program [at] 1 which includes a 'timespec' for parsing time-like phrases into dates. This extends the original scope to include the past and various other changes. It's similar, but not exactly the same.

usage

timespec = require('timespec');

var is_now = timespec.parse('now');
var is_now_last_week = timespec.parse('last week');

var is_noon_today = timespec.parse('noon');
var is_noon_yesterday = timespec.parse('noon yesterday');

var is_12_weeks_ago = timespec.parse('last 12 weeks');
var is_12_weeks_from_now = timespec.parse('next 12 weeks');

var is_2_hour_from_now = timespec.parse('now - 2 hours');

Keywords

time

FAQs

Package last updated on 14 Sep 2013

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