๐ŸŒ A time zone helper

Related tags

Date and Time tz
Overview

๐ŸŒ A time zone helper

tz helps you schedule things across time zones. It is an interactive TUI program that displays time across a few time zones of your choosing.

Installing

The quickest thing is probably to grab a release, but no one will be harmed if you build from source.

Usage

Start tz to show the local time, as well as the UTC time zone. It's nicer to set the TZ_LIST environment variable with a comma-separated list of tz data zone names:

Configuration

Zone Alias

tz is configured only through TZ_LIST, and that limits us to the tz database names, but you can alias these names using a special value: the tz name followed by ; and your alias:

TZ_LIST="Europe/Paris;EMEA office,US/Central;US office"

Building

Clone this repository and run:

go build .

License

The GPL3 license.

Copyright (c) 2021 Arnaud Berthomier

Comments
  • More Options?

    More Options?

    Since -q is coming to a future release near you can we also add -v and/or -version/--version so we can check what version is installed without having to dig into the package manager, please? I'd ask for -h and -help/--help but you get that for free with the flag package. ๐Ÿ‘ผ

    opened by runeimp 4
  • Display name for selected TZ

    Display name for selected TZ

    enhancement

    This may or may not be worthwhile for you. I tend to think of the people I'm working with in terms of the city/country that they work in. Since the standard TZ database is small by design, it doesn't really allow one to be specific. For instance, America/Tampa Bay isn't a thing, and so you would choose America/New York or America/Detroit to get to the Eastern Time zone. Off the top of my head, something like:

    TZ_LIST=America/Detroit;Tampa Bay,America/Chicago;Minneapolis

    Would allow one to display Tampa Bay and Minneapolis for those two time zones.

    Just a thought, I love the simplicity of the interface, and using TZ_LIST seems just fine, I didn't see, is there a way to get tz to list out the TZ names for a particular UTC offset?

    opened by cmaahs 4
  • Introducing -24 and -l flags

    Introducing -24 and -l flags

    As suggest in https://github.com/oz/tz/pull/13, I've converted the 2 features from environment variables to flags. This required to move the "-q" flag to the config.go file to not have double flag parsing. I've also added a proper "usage"-text for the "-h" help flag

    In addition, the test "SetupZoneWithCustomNames" was failing, due to the recent DST change in Europe. As a simple fix for now I set it to "CEST".

    As long term fix I suggest: 12 days ago Time.IsDST() has been PR'ed to Golang: golang/go#42103 Once the PR is released, the test can be adjusted to reflect DST changes easily

    opened by wneessen 3
  • Introducing two new config parameters

    Introducing two new config parameters

    • TZ_LOCAL_NAME: allows to override the display of "Local" with a name of coice
    • TZ_24H: allows to display the header time in 24h format instead of 12h format
    opened by wneessen 3
  • Feature idea: Dates and times in the past and future

    Feature idea: Dates and times in the past and future

    It would be cool to have an optional argument for a date in the future or past for scheduling events that are not today.

    Usage could be something like this:

    tz -d $(date -d '+6 month' +%Y-%m-%d)
    
    opened by TechnologyClassroom 3
  • -q doesn't work

    -q doesn't work

    1st off, great tool. Love it!

    Now, I installed this tool via Homebrew on my MBP running macOS 10.14.6 Mojave. It works great except for the -q not working. I see that -q was only added to the repos main branch 15 hours ago so maybe it didn't make it into the release used on Homebrew. Just checked and Homebrew is currently using v0.4 and checking the v0.4 tag I see flag package using in main is not present. OK, no prob. Just a note for others who are confused then. Will the -q option be present in v0.5 then?

    opened by runeimp 2
  • CurrentVersion wasn't updated for 0.6.2 release

    CurrentVersion wasn't updated for 0.6.2 release

    $  tz -v       
    tz 0.6.1
    

    Ideally this would be automated in some way -- right now the compiled-in version string is hardcoded in main.go: https://github.com/oz/tz/blob/main/main.go#L31

    opened by mitchblank 1
  • Is 0.6.2 an actual release?

    Is 0.6.2 an actual release?

    I noticed that a month ago a "v0.6.2" tag appeared in this repo: https://github.com/oz/tz/tags (which currently matches main -- e23d811)

    ... but 0.6.1 is still the most recent "release" https://github.com/oz/tz/releases

    Is this intentional? Is that tag going to become a release later, or is last year's 0.6.1 still considered "current"?

    I ask because right now homebrew is confused, because it's scanning the version-number-looking git tags in the repo:

    $  brew livecheck --verbose tz
    tz (guessed): 0.6.1 ==> 0.6.2
    

    If 0.6.1 is really the correct "latest release" I can tweak the homebrew livecheck rules for that formula to only consider the github release page and ignore tags. But I don't want to do that if 0.6.2 is merely an accidentally-forgotten release

    opened by mitchblank 1
  • Recognize top world cities

    Recognize top world cities

    I love the program, but it cannot tell me time for example in Dallas, which would be very handy. It would take a map of large cities to timezones. I can contribute this part, if you take PRs.

    wontfix 
    opened by dkotik 1
  • Cannot display more than 2 timezones

    Cannot display more than 2 timezones

    On arch, I am able to provide up to two timezones, any further timezone is ignored.

    โฏ TZ_LIST="Europe/Berlin;America/Santiago" tz
    
      What time is it?
    
      ๐Ÿ•› (CEST) Local 12:07PM, Sat 15
       0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22
    
      ๐Ÿ•• (-04) America/Santiago 6:07AM, Sat 15
      18  19  20  21  22  23   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16
    
    
     
    โฏ TZ_LIST="Europe/Berlin;Asia/Bangkok;America/Santiago" tz
    
      What time is it?
    
      ๐Ÿ•› (CEST) Local 12:08PM, Sat 15
       0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22
    
      ๐Ÿ•› (CEST) Europe/Berlin 12:08PM, Sat 15
       0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22
    
    opened by chris-aeviator 1
  • Suggestion: Auto build binaries for different OS on release

    Suggestion: Auto build binaries for different OS on release

    I've recently discovered a nice Github workflow, that automagically creates binaries for (almost) all supported Go binary formats. Once a new Github release has been drafted, the action will build binaries (including a checksum file) for Linux, Windows, MacOS and *BSD and append it to the release page. This would help people without a go build environment to easily get hands on a tz-binary.

    I've added the workflow to a project of mine, and it works like a charme. You can see an example here: https://github.com/wneessen/apg.go/releases/tag/v0.2.9

    The action can be found on Github Marketplace: https://github.com/marketplace/actions/go-release-binaries

    Since Github workflows (to my knowledge) cannot be PR'ed, I link to the workflow files I am currently using, which have been proven to work w/o issues: *BSD: https://github.com/wneessen/apg.go/blob/main/.github/workflows/release-bsd.yml MacOS: https://github.com/wneessen/apg.go/blob/main/.github/workflows/release-darwin.yml Linux: https://github.com/wneessen/apg.go/blob/main/.github/workflows/release-linux.yml Windows: https://github.com/wneessen/apg.go/blob/main/.github/workflows/release-windows.yml

    opened by wneessen 1
  • cmd line accept timezone abbreviations

    cmd line accept timezone abbreviations

    It is tedious and error prone to enter full names. For most people using timezones regulalry we will remember the most used zone abbreviations e.g. AEDT instead of australia/sydney or CST instead of america/los_angeles

    enhancement help wanted 
    opened by 26labs 1
  • Sliding time window

    Sliding time window

    I want to be able to use this for choosing appropriate hours of the day between cities.

    The site I use most for this is timeanddate.com

    E.g. https://www.timeanddate.com/worldclock/meetingtime.html?iso=20221023&p1=446&p2=4

    In some cases for the current day, there isn't sufficient overlap in working hours to schedule a meeting time, so I want to advance to the next 24 hours of overlap.

    When moving the cursor to the right, it currently just winds back around to the beginning of the current 24 hour window, I propose that it now advances and redraws or advances the window forward in time.

    enhancement 
    opened by dalanmiller 1
  • [feature] Display all timezones

    [feature] Display all timezones

    When first coming to this repository I found

    grafik

    particulary appealing since I expected ยดtzยด without further arguments to display

    A) a list of all timezones B) timezones at night having a dark background / timezones currently in daytime having a light background

    I think both would make for useful features. Could you think of implementing this?

    When running ยดtzยด I will see my timezone compared to only UTC with a dark background currently.

    enhancement help wanted 
    opened by chris-aeviator 1
  • List known timezones

    List known timezones

    The biggest problem I had with getting started with TZ was populating TZ_LIST. The screenshot showed entries like "-07" and "GMT" but the TZ_LIST only understands the full/city_name style. So it'd be helpful if tz had a flag to dump the list, so I could at least grep for relevant entries. Ideally there'd be a UI where I can search and add timezones that tz will remember (~/.config/tz) for next launch.

    enhancement 
    opened by donpdonp 5
Releases(v0.6.2)
Owner
Arnaud Berthomier
Mostly harmless
Arnaud Berthomier
Carbon for Golang, an extension for Time

Carbon A simple extension for Time based on PHP's Carbon library. Features: Time is embedded into Carbon (provides access to all of Time's functionali

Uniplaces LTD 742 Dec 20, 2022
:clock8: Better time duration formatting in Go!

durafmt durafmt is a tiny Go library that formats time.Duration strings (and types) into a human readable format. go get github.com/hako/durafmt Why

Wesley Hill 453 Dec 16, 2022
:clock1: Date and Time - Golang Formatting Library

Kair Date and Time - Golang Formatting Library Setup To get Kair > Go CLI go get github.com/GuilhermeCaruso/kair > Go DEP dep ensure -add github.com/G

Guilherme Caruso 24 Sep 26, 2022
Now is a time toolkit for golang

Now Now is a time toolkit for golang Install go get -u github.com/jinzhu/now Usage Calculating time based on current time import "github.com/jinzhu/n

Jinzhu 4k Dec 23, 2022
Golang package to manipulate time intervals.

timespan timespan is a Go library for interacting with intervals of time, defined as a start time and a duration. Documentation API Installation Insta

null 82 Sep 26, 2022
timeutil - useful extensions (Timedelta, Strftime, ...) to the golang's time package

timeutil - useful extensions to the golang's time package timeutil provides useful extensions (Timedelta, Strftime, ...) to the golang's time package.

Kyoung-chan Lee 190 Dec 22, 2022
Go time library inspired by Moment.js

Goment Current Version: 1.4.0 Changelog Goment is a port of the popular Javascript datetime library Moment.js. It follows the Moment.js API closely, w

Nick Leeper 209 Dec 24, 2022
fasttime - fast time formatting for go

fasttime - fast time formatting for go

phuslu 67 Dec 13, 2022
Clock is a small library for mocking time in Go.

clock Clock is a small library for mocking time in Go. It provides an interface around the standard library's time package so that the application can

Ben Johnson 606 Dec 30, 2022
A natural language date/time parser with pluggable rules

when when is a natural language date/time parser with pluggable rules and merge strategies Examples tonight at 11:10 pm at Friday afternoon the deadli

Oleg Lebedev 1.2k Dec 26, 2022
Copy of stdlib's time.Duration, but ParseDuration accepts other bigger units such as days, weeks, months and years

duration Copy of stdlib's time.Duration, but ParseDuration accepts other units as well: d: days (7 * 24 * time.Hour) w: weeks (7 * Day) mo: months (30

Carlos Alexandro Becker 11 Jun 21, 2022
time format golang

a simple plugin to change date and time format

Ibnu Surkati 2 Sep 29, 2021
Structural time package for jalali calendar

Jalali Structural time package for jalali calendar. This package support parse from string, json and time. Structures There are three data structures

Bardo Go Framework 1 Mar 21, 2022
Show time by timezone

Show time by timezone

Michael Bruskov 1 Jan 22, 2022
Timediff is a Go package for printing human readable, relative time differences ๐Ÿ•ฐ๏ธ

timediff is a Go package for printing human readable, relative time differences. Output is based on ranges defined in the Day.js JavaScript library, and can be customized if needed.

MergeStat 289 Dec 25, 2022
Go-timeparser - Flexible Time Parser for Golang

go-timeparser Flexible Time Parser for Golang Installation Download timeparser w

Kazuaki Yamamoto 2 Dec 29, 2022
DNS server using miekg/dns offering dynamic subdomains, time-over-dns, and standard zone file support.

dns-go DNS server using miekg/dns offering dynamic subdomains, time-over-dns, and standard zone file support. dynamic subdomains web.myapp.192.168.1.1

Jean Ribes 0 Dec 14, 2021
Go implementation of isparkes/time-zone-server

nixie-time-zone-server Go implementation of isparkes/time-zone-server This is a Go server which gives back the local time anywhere in the world, given

Adam Bernstein 0 Dec 8, 2021
Go package provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name,

IP2Location Go Package This Go package provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, co

IP2Location 308 Jan 8, 2023
Zms - The Bhojpur ZMS is a software-as-a-service product applied in different risk management areas. It is a containment Zone Management System based on Bhojpur.NET Platform.

Bhojpur ZMS - Zone Management System The Bhojpur ZMS is a software-as-a-service product used as a Zone Management System based on Bhojpur.NET Platform

Bhojpur Consulting 0 Sep 26, 2022