Git Product home page Git Product logo

when's Introduction

example

when: a timezone utility for the command line

Build Status Crates.io License

$ when "now in vienna"

when is a small utility which tells you what time it is somewhere or what some time is somewhere. You can use it from the command line or uses it online from the browser.

These are some input examples:

  • now
  • 2 hours ago in yyz
  • 5pm in yyz -> sfo
  • 5pm in vienna -> london
  • 4pm on 17.05.2021 in vienna -> tokyo
  • 4pm yesterday in vienna -> vienna va
  • in 4 hours in san francisco
  • 2pm in 2 days in new delhi
  • now in yyz -> sfo -> vie -> lhr
  • unix 1639067620 in tokyo

Installation

Conveniently via cargo:

$ cargo install when-cli

There is also an online version you can use from your browser.

Note that this project requires a Rust 2021 compatible compiler (1.56.0 or later). Attempting to install this package on an older compiler will result in compilation errors (feature `edition2021` is required). If you're using rustup make sure to update (rustup update), you might be on an older version.

Usage

Basically takes a single argument which is a string which describes the format in roughly this syntax. Both locations are optional. The "local" location always refers to the current machine's timezone.

time and date in location -> other location

Multiple locations can be suplied by using the arrow operator multiple times. This means you can do things like now in yyz -> sfo -> vie.

Time and date can be provided roughly like this:

  • 2:30pm, 14:30, 7:00, now
  • 14:30 tomorrow
  • 14:30
  • 17:00 on 20.05. (DD.MM.)
  • 17:00 on 20.05.2020 (DD.MM.YYYY)
  • relative times (in 4 hours or 4 hours ago)
  • unix timestamps (unix:TS or unix TS)

For locations many major cities are supported as well as common timezone names like Europe/Vienna. A certain amount of disambiugation is possible with city names. For instance Vienna VA (Virginia) is different than Vienna AT (Austria).

when's People

Contributors

badboy avatar mitsuhiko avatar narqo avatar plaes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.