Skip to content
/ timey Public

A command line utility for parsing and formatting timestamps, written in Rust.

License

Notifications You must be signed in to change notification settings

ptrbrynt/timey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Timey

Build Status Crates.io Crates.io Libraries.io dependency status for GitHub repo Crates.io

Timey is a command-line application written in Rust which allows for quick and easy translation between timestamps and formatted date-times.

Installation

First you'll need to install Rust. There are instructions here.

Once you have Rust installed, simply run:

cargo install timey

Usage

Parse a date-time string into a timestamp

$ timey parse '2019-03-05 00:00 +0100' --format '%Y-%m-%d %H:%M %z'
1551744000
$ timey parse '2019-03-05T00:00+01:00'
1525521780

Format a timestamp as a date-time string

$ timey format 1525521780
2019-03-05T00:00+01:00
timey format 1525521780 -f '%Y-%m-%d'
2018-05-05

Formatting Options

For a full list of formatting specifiers, see here.

Options

-c, --copy # Copy the result to your the clipboard
-f, --format # The date format to use for parsing/formatting
-m, --millis # Use timestamps in millis rather than seconds
-h, --help # Display help

Display Current Time

The -c flag for copying the result to the clipboard also works with these commands.

As a timestamp

$ timey now display
1551908316
$ timey now display -m
1551908316000

As a formatted date-time string

$ timey now format
2019-03-06T21:38:30.265352+00:00
$ timey now format -f '%Y-%m-%d'
2019-03-06

About

A command line utility for parsing and formatting timestamps, written in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages