Code Monkey home page Code Monkey logo

datex's Introduction

DateX

A simple CLI date calculator

Installation

npm install -g datex-cli

Usage

datex <value1> <operator> <value2> <operator> <value3>.... to <output format>

Note: every operation is applied to the result of the previous one

Example 1:

datex now - 400hours to YYYY-MM-DD

calculates the datetime of 400 hours before current time and parses it to the given format

Example 2:

datex now - 400hours diff 2012-07-08 to h

calculates the datetime of 400 hours before current time and then calculates the difference between the result and2012-07-08 converting it to hours

Operations

  • Add/Subtract: "+", "-"
  • Comparison: "=", "aft", "bef", "afteq", "befeq"
  • Diff: "diff"

Date Aliases

  • Today at 00:00:00: "today", "td"
  • Current time: "now"

Date Formats

  • YYYY-MM-DDThh:mm:ss
  • DD/MM/YYYY hh:mm:ss
  • ...anything generally accepted will fit

Absolute values format:

<value><unit>
# e.g.: 500d

Time Units Aliases

  • Years: "year", "years", "y"
  • Months: "month", "months", "M"
  • Weeks: "week", "weeks", "W", "w"
  • Days: "day", "days", "D", "d"
  • Hours: "hour", "hours", "h", "H"
  • Minutes: "minute", "minutes", "m", "min"
  • Seconds: "second", "seconds", "s", "S", "sec"
  • Milliseconds: "millisecond", "milliseconds", "ms", "MS", "milli", "millis"

datex's People

Contributors

twoojoo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.