🕛Handy epoch converter

Related tags

Utilities epo
Overview

Test codecov

epo

Handy epoch converter.

$ epo 1647165000 1647165000+300 "1647165000+300*2" "1647165000+300*3" los_angeles phoenix gmt

|      Epoch |      America/Los_Angeles |          America/Phoenix |                      GMT |
| ---------- | ------------------------ | ------------------------ | ------------------------ |
| 1647165000 | 2022-03-13T01:50:00-0800 | 2022-03-13T02:50:00-0700 | 2022-03-13T09:50:00+0000 |
| 1647165300 | 2022-03-13T01:55:00-0800 | 2022-03-13T02:55:00-0700 | 2022-03-13T09:55:00+0000 |
| 1647165600 | 2022-03-13T03:00:00-0700 | 2022-03-13T03:00:00-0700 | 2022-03-13T10:00:00+0000 |
| 1647165900 | 2022-03-13T03:05:00-0700 | 2022-03-13T03:05:00-0700 | 2022-03-13T10:05:00+0000 |
It prints a Markdown formatted table.
Epoch America/Los_Angeles America/Phoenix GMT
1647165000 2022-03-13T01:50:00-0800 2022-03-13T02:50:00-0700 2022-03-13T09:50:00+0000
1647165300 2022-03-13T01:55:00-0800 2022-03-13T02:55:00-0700 2022-03-13T09:55:00+0000
1647165600 2022-03-13T03:00:00-0700 2022-03-13T03:00:00-0700 2022-03-13T10:00:00+0000
1647165900 2022-03-13T03:05:00-0700 2022-03-13T03:05:00-0700 2022-03-13T10:05:00+0000

Installation

Brew (Only for OSX)

brew tap wtetsu/epo
brew install epo

Download binary

https://github.com/wtetsu/epo/releases

From source code

cargo install epo

Examples

Epoch -> Date

$ epo 1648771200 1648771200+86400 "1648771200+86400*2" los_angeles greenwich tokyo

|      Epoch |      America/Los_Angeles |                Greenwich |               Asia/Tokyo |
| ---------- | ------------------------ | ------------------------ | ------------------------ |
| 1648771200 | 2022-03-31T17:00:00-0700 | 2022-04-01T00:00:00+0000 | 2022-04-01T09:00:00+0900 |
| 1648857600 | 2022-04-01T17:00:00-0700 | 2022-04-02T00:00:00+0000 | 2022-04-02T09:00:00+0900 |
| 1648944000 | 2022-04-02T17:00:00-0700 | 2022-04-03T00:00:00+0000 | 2022-04-03T09:00:00+0900 |
Other examples
$ epo 0

| Epoch | +0900                    |
| ----- | ------------------------ |
| 0     | 1970-01-01T09:00:00+0900 |
$ epo 0 +9 +1 -5

| Epoch |                    +0900 |                    +0100 |                    -0500 |
| ----- | ------------------------ | ------------------------ | ------------------------
|     0 | 1970-01-01T09:00:00+0900 | 1970-01-01T01:00:00+0100 | 1969-12-31T19:00:00-0500 |
$ epo 0 tokyo london new_york

| Epoch |               Asia/Tokyo |            Europe/London |         America/New_York |
| ----- | ------------------------ | ------------------------ | ------------------------
|     0 | 1970-01-01T09:00:00+0900 | 1970-01-01T01:00:00+0100 | 1969-12-31T19:00:00-0500 |

You can write JavaScript code.

$ epo 1651313524 1651313524+86400 1651313524-86400 london

|      Epoch |            Europe/London |
| ---------- | ------------------------
| 1651313524 | 2022-04-30T11:12:04+0100 |
| 1651399924 | 2022-05-01T11:12:04+0100 |
| 1651227124 | 2022-04-29T11:12:04+0100 |
$ epo "[now, now+86400, now+86400*2]" Monaco London Tokyo

|      Epoch |            Europe/Monaco |            Europe/London |               Asia/Tokyo |
| ---------- | ------------------------ | ------------------------ | ------------------------
| 1651313675 | 2022-04-30T12:14:35+0200 | 2022-04-30T11:14:35+0100 | 2022-04-30T19:14:35+0900 |
| 1651400075 | 2022-05-01T12:14:35+0200 | 2022-05-01T11:14:35+0100 | 2022-05-01T19:14:35+0900 |
| 1651486475 | 2022-05-02T12:14:35+0200 | 2022-05-02T11:14:35+0100 | 2022-05-02T19:14:35+0900 |
$ epo "range(100).map(a=>now+86400*a)" Monaco London Tokyo
|      Epoch |            Europe/Monaco |            Europe/London |               Asia/Tokyo |
| ---------- | ------------------------ | ------------------------ | ------------------------
| 1651313711 | 2022-04-30T12:15:11+0200 | 2022-04-30T11:15:11+0100 | 2022-04-30T19:15:11+0900 |
| 1651400111 | 2022-05-01T12:15:11+0200 | 2022-05-01T11:15:11+0100 | 2022-05-01T19:15:11+0900 |
...
| 1659780911 | 2022-08-06T12:15:11+0200 | 2022-08-06T11:15:11+0100 | 2022-08-06T19:15:11+0900 |
| 1659867311 | 2022-08-07T12:15:11+0200 | 2022-08-07T11:15:11+0100 | 2022-08-07T19:15:11+0900 |

Date -> Epoch

$ epo 2022-04-01T00:00:00 2022-04-02T00:00:00 2022-04-03T00:00:00 los_angeles greenwich tokyo

|                Date | America/Los_Angeles |  Greenwich | Asia/Tokyo |
| ------------------- | ------------------- | ---------- | ---------- |
| 2022-04-01T00:00:00 |          1648796400 | 1648771200 | 1648738800 |
| 2022-04-02T00:00:00 |          1648882800 | 1648857600 | 1648825200 |
| 2022-04-03T00:00:00 |          1648969200 | 1648944000 | 1648911600 |

Advanced

You can also write JavaScript code (range returns an array).

epo "range(10).map(i=>1647165300+i*60)" los_angeles phoenix

epo prints a Markdown formatted table, so it can be pasted as is.

Epoch America/Los_Angeles America/Phoenix
1647165300 2022-03-13T01:55:00-0800 2022-03-13T02:55:00-0700
1647165360 2022-03-13T01:56:00-0800 2022-03-13T02:56:00-0700
1647165420 2022-03-13T01:57:00-0800 2022-03-13T02:57:00-0700
1647165480 2022-03-13T01:58:00-0800 2022-03-13T02:58:00-0700
1647165540 2022-03-13T01:59:00-0800 2022-03-13T02:59:00-0700
1647165600 2022-03-13T03:00:00-0700 2022-03-13T03:00:00-0700
1647165660 2022-03-13T03:01:00-0700 2022-03-13T03:01:00-0700
1647165720 2022-03-13T03:02:00-0700 2022-03-13T03:02:00-0700
1647165780 2022-03-13T03:03:00-0700 2022-03-13T03:03:00-0700
1647165840 2022-03-13T03:04:00-0700 2022-03-13T03:04:00-0700

In the above table, you can see the moment when Los Angeles enters daylight saving time: -0800 becomes -0700, and suddenly it is 03:00. Incidentally, Phoenix is known as an area in the U.S. where daylight saving time is not adopted, and it remains at -0700 all the time.

License

epo is published under the MIT license.

Third-party data

This project includes some third-party data:

Images

Great Rust libraries

You might also like...
a handy utility to work with encrypted DMGs

edmgutil edmgutil is a simple wrapper utility to hdiutil to help you work with disposable, encrypted DMGs. It can decompress an encrypted ZIP into a n

A handy calculator, based on Rust and WebAssembly.
A handy calculator, based on Rust and WebAssembly.

qubit 💥 Visit Website To Use Calculator Example 💥 Visit Website To Use Calculator 2 + 2

A handy way to handle sh/bash cli parameters
A handy way to handle sh/bash cli parameters

Argc A handy way to handle sh/bash cli parameters. How Argc works To write a command line program with Argc, we only need to do two things: Describe t

Handy macro to generate C-FFI bindings to Rust for Haskell

hs-bindgen Handy macro to generate C-FFI bindings to Rust for Haskell. This library intended to work best in a project configured by cargo-cabal. N.B.

An handy tool that is intended to help your inventory cleanup or dump.

NeosVR Inventory Management Notes to foreign users This readme is written in Japanese. Please use external tool to translate this document into your l

locdev is a handy CLI tool that simplifies the process of adding, removing, and listing entries in the hosts file.

locdev 🛠️ locdev is a handy CLI tool that simplifies the process of adding, removing, and listing entries in the hosts file. You no longer need to de

Artsy pixel image to vector graphics converter
Artsy pixel image to vector graphics converter

inkdrop inkdrop is an artsy bitmap to vector converter. Command line interface The CLI binary is called inkdrop-cli and reads almost any image bitmap

A Simple Image to Ascii converter in Rust
A Simple Image to Ascii converter in Rust

Image to Ascii A Simple Image to Ascii converter in Rust Brief 📖 In my way to learn Rust i decided to make this converter. Challenges 🐢 new to Rust

Converter valores entre moedas com RUST.
Converter valores entre moedas com RUST.

Exchange Rust 🦀 Uma CLI escrita em Rust que converte um valor de uma moeda para outra consumindo a API CurrencyConverterApi (projeto de estudo). Util

Camera RAW to DNG file format converter

DNGLab - A camera RAW to DNG file format converter Command line tool to convert camera RAW files to Digital Negative Format (DNG). It is currently in

A fast wordlist to nthash converter

nthasher A fast wordlist to nthash converter Usage Pass it a UTF8 encoded wordlist, and write the output to a file. ./nthasher wordlist wordlist.n

elite - c converter

elite - c converter

elite - python3 converter

elite - python3 converter

elite - rust converter

elite - rust converter

elite - c++17 converter

elite - c++17 converter

An intel PT trace converter from `perf.data` to Fuchsia trace format.
An intel PT trace converter from `perf.data` to Fuchsia trace format.

Introduction Recent Intel processors feature the "Intel Processor Trace" feature, which can be used to capture the full execution trace of a program.

TI LDC1312/LDC1314/LDC1612/LDC1614 inductance-to-digital converter driver for Rust embedded-hal

ldc1x1x Rust embedded-hal 1.x driver for Texas Instruments (TI) I²C inductance-to-digital converters (LDC): LDC1312/LDC1314, LDC1612/LDC1614. Includes

Markdown to HTML converter written in Rust. Inspired by Katsuki Yuri's Makudaun Tool.
Markdown to HTML converter written in Rust. Inspired by Katsuki Yuri's Makudaun Tool.

Makurust Makurust is a powerful tool written in Rust that allows you to effortlessly convert your Markdown files into static HTML pages. Inspired by T

💱 A crusty currency converter
💱 A crusty currency converter

💱 moneyman A crusty currency converter Example $ moneyman convert 50 --from EUR --to PHP --on 2023-05-06 --fallback 50 EUR - 3044.5833333333350 PHP

Owner
Tetsu
Tetsu
simple epoch-based reclamation

ebr a simple epoch-based reclamation (EBR) library with low cacheline ping-pong. use ebr::Ebr; let mut ebr: Ebr<Box<u64>> = Ebr::default(); let mut

Tyler Neely 18 Nov 20, 2022
Converter valores entre moedas com RUST.

Exchange Rust ?? Uma CLI escrita em Rust que converte um valor de uma moeda para outra consumindo a API CurrencyConverterApi (projeto de estudo). Util

Tulio Calil 5 Nov 9, 2021
elite -> c converter

elite -> c converter

Ferhat Geçdoğan 1 Feb 11, 2022
elite -> python3 converter

elite -> python3 converter

Ferhat Geçdoğan 2 Nov 9, 2022
TI LDC1312/LDC1314/LDC1612/LDC1614 inductance-to-digital converter driver for Rust embedded-hal

ldc1x1x Rust embedded-hal 1.x driver for Texas Instruments (TI) I²C inductance-to-digital converters (LDC): LDC1312/LDC1314, LDC1612/LDC1614. Includes

null 2 Oct 2, 2022
Humanize epoch conversions

REPOCH REPOCH is cli to convert epoch timestamp datetime and datetime to timestamp. Its convert a epoch time from utc to datetime. Building for source

Luca Lacerda 19 Jan 14, 2022
simple epoch-based reclamation

ebr a simple epoch-based reclamation (EBR) library with low cacheline ping-pong. use ebr::Ebr; let mut ebr: Ebr<Box<u64>> = Ebr::default(); let mut

Tyler Neely 18 Nov 20, 2022
gstats — command line tool to print a developer handy summary of all git repositories below current directory

gstats Simple Rust tool to get quick summary info on git repos showing latest tag, branch, state. I implemented this to help me work with a the not to

Boon at Shift 12 Jun 10, 2021
Simple and handy btrfs snapshoting tool. Supports unattended snapshots, tracking, restoring, automatic cleanup and more. Backed with SQLite.

Description Simple and handy btrfs snapshoting tool. Supports unattended snapshots, tracking, restoring, automatic cleanup and more. Backed with SQLit

Eduard Tolosa 27 Nov 22, 2022
🤖 just is a handy way to save and run project-specific commands.

just just is a handy way to save and run project-specific commands. (非官方中文文档,这里,快看过来!) Commands, called recipes, are stored in a file called justfile

Casey Rodarmor 8.2k Jan 5, 2023