Skip to content

pravo23/epoch-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Epoch Converter CLI Application

This command line tool allows you to convert timestamps to human-readable datetime and vice versa. It's useful for developers working with timestamps in various scenarios.

Installation

Ensure you have Node.js installed on your machine.

From NPM Package

You can install the Epoch CLI Tool from the NPM package epoch-cli-tool:

npm i -g epoch-cli-tool

From Source

Clone this repository:

git clone <repository-url>

Navigate to the project directory and install dependencies:

cd <project-directory>
npm i -g

Usage

Convert Timestamp to Human-Readable Datetime

$ epoch dt <timestamp>

This command converts a given timestamp to a human-readable datetime in both local and GMT timezones.

Example:

$ epoch dt 1617500000000

Convert Human-Readable Datetime to Timestamp

$ epoch ts <datetime>

This command converts a given human-readable datetime to a timestamp, both in seconds and milliseconds.

Example:

$ epoch ts "Jan 1, 2023 12:00:00"

Note:

  • For the dt command, if the timestamp is provided in milliseconds, it's automatically detected. Otherwise, it's assumed to be in seconds.
  • For the ts command, the datetime should be enclosed in double quotes and follow the format "Month Day, Year Hour:Minute:Second", e.g., "Jan 1, 2023 12:00:00".
  • The tool displays both local time and GMT time for better clarity.

Dependencies

  • commander: For creating command-line interfaces.
  • chalk: For styling command line output.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A CLI Tool to convert timestamps to human-readable datetime & vice versa.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published