Skip to content

stevenbraham/unixtime

Repository files navigation

Unixtime

I often need to use Unix timestamps to search for stuff in MySQL tables. So I wrote this tool to quickly convert a date string to an Unix timestamp and vice versa.

Credits to the date-util library for providing the strtotime parser.

Installation

  1. Clone this repo
  2. Install dependencies: npm install
  3. Run Webpack to generate a build: npm run build
  4. (For Unix systems) add executable permissions: chmod +x bin/index.js
  5. Make the CLI tool globally available on your system: npm install -g .

Usage

After installation the tool should be available as the unixtime command. There are two sub commands:

to-unix

This is the default command. Use unixtime <string> or unixtime to-unix <string> to convert an English datestring to an Unix timestamp. Eg. unixtime to-unix "+30 days"

from-unix

Use unixtime from-unix <timestamp> to convert an Unix timestamp back to a normal datetime string.

About

CLI tool that allows you turn an English date string into a an Unix timestamp from your CLI

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published