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.
Ensure you have Node.js installed on your machine.
You can install the Epoch CLI Tool from the NPM package epoch-cli-tool
:
npm i -g epoch-cli-tool
Clone this repository:
git clone <repository-url>
Navigate to the project directory and install dependencies:
cd <project-directory>
npm i -g
$ epoch dt <timestamp>
This command converts a given timestamp to a human-readable datetime in both local and GMT timezones.
Example:
$ epoch dt 1617500000000
$ 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"
- 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.
This project is licensed under the MIT License - see the LICENSE file for details.