5 ms·
Tz: A Time Zone Helper
- SamBorick 6y agoFor a similar experience on the web I highly recommend https://everytimezone.com/ https://everytimezone.com/
- Zenst 6y agoI see they handle Daylight saving, albeit they flag that entire week as the change from what I can see for the UK which has a change from GMT to BST (which they call UST+1) on the 28th - yet whole week gets labelled that in which it changes. Personally I'll be glad when we do away with such daylight saving TZ changes.
- globular-toast 6y agoIt doesn't seem to handle DST properly at all. If I set the date to the 27th, it shows London on the 28th being GMT, if I set it to the 28th it shows London on the 27th being BST. Both wrong. It should instead show the 28th as being only a 23 hour day and the 31st October being a 25 hour day.
- globular-toast 6y ago> The program will adjust to light and dark terminals themes. Instead of doing this you should use named colours. "Green" in my terminal is definitely the correct green for my terminal theme.
- chrismorgan 6y agoLook, you and I may have sane ANSI 16 colours, but it’ll be a very significant fraction of people that don’t (and almost no one will customise the next 240 colours). Remember things like that there’s a distressingly high chance that blue is almost invisible against black, and even bright blue’s contrast is commonly much too low—to say nothing of the limited palette range. But what this program is doing is using termenv’s HasDarkBackground function to decide whether the terminal is light or dark, and is then specifying RGB colours. It’ll try to guess whether to use 16 colours, 256 colours or 24-bit colour and do some kind of mapping down if necessary (which I bet this app makes a total hash of, probably not having chosen the colours carefully). But the way it figures out the terminal’s background colour… ugh. Some terminals will support it, but for many it’ll fail and just assume black. Looks like on unix you could set an environment variable COLORFGBG to override this, https://github.com/muesli/termenv/blob/6bb55115565c27f4cc681c633422a3eb7fa95872/termenv_unix.go#L73 https://github.com/muesli/termenv/blob/6bb55115565c27f4cc681..., but if you’re on Windows, tough luck, apparently you’re not allowed to have a light terminal (which you can get in Command Prompt by running `color f0`): https://github.com/muesli/termenv/blob/537e36cb0472a69a3c82864b7cbae8e6719c72f3/termenv_windows.go#L14-L17 https://github.com/muesli/termenv/blob/537e36cb0472a69a3c828.... The simple fact of the matter is that there are no particularly good solutions for handling colour in terminals if you want the colours to cohere and naturally map to real-world colour understanding, which is what something like this would prefer to be able to do. Things are just barely OK if you just want colours with no inherent semantics. So… yeah, might be nice if they used the 16 colours, but I can readily understand them not doing so, and if they did do so, although it’d make it better for some, it’d make it worse for others. Where does the balance lie? I dunno.
- muskox2 6y agoI think the best thing to do is use the first 16 named colors and give users the option to disable colors if they want. This supports most use-cases.
- TeMPOraL 6y agoThe best way would be if the software just outputted objects instead of text, and let the user style them for display in any way they want :).
- zamadatix 6y agoAgree for raw "syntax highlighting" styling output, disagree for styling the output such as here where the gradient represents additional information/context. Especially since it takes the terminal background configuration into consideration when making that choice.
- geocrasher 6y agoThis is very neat! I can use this at work where I talk to people from all over the world on a regular basis. Will it displace https://worldtimebuddy.com/ https://worldtimebuddy.com/ in my workflow? I don't know, but it'll be fun to find out. Not being one of the Cool Kids who has a golang environment ready to go, I logged into my trusty CentOS 7 box and installed golang with "yum install go" which went fine. I cloned the rep and attempted to build: git clone https://github.com/oz/tz https://github.com/oz/tz cd tz go build Nothing. Nada. Dead. Not even an error. Some googling[1] led me to 'go list -x' to list the modules, which was failing. I suspected failed IPv6 resolution (an issue on this box) so some more googling[2] led me to add this in /etc/gai.conf: precedence ::ffff:0:0/96 100 This solved the problem with IPv6 hanging up, as IPv4 is now the preference. Neat. Now, it still failed with another error: invalid pseudo-version This appeared to be due to an older version of git, so I installed a newer version, again after some googling[3]: yum -y erase git yum -y install https://repo.ius.io/ius-release-el7.rpm https://repo.ius.io/ius-release-el7.rpm yum -y install git222 I also had to reinstall golang with 'yum install go' and now I am rewarded with a completed 'go build'. Neat! I am looking forward to checking this little program out. [1] https://github.com/golang/go/issues/16104 https://github.com/golang/go/issues/16104 [2] https://stackoverflow.com/a/21672312 https://stackoverflow.com/a/21672312 [3] https://github.com/golang/go/issues/38373#issuecomment-701879990 https://github.com/golang/go/issues/38373#issuecomment-70187...
- svieira 6y agoYour travails reminds me of Joe Armstrong's talk _The Mess We're In_ where he talks about the pains he had getting his slides for the talk ready: https://www.youtube.com/watch?v=lKXe3HUG2l4 https://www.youtube.com/watch?v=lKXe3HUG2l4
- ydant 6y agoSeconding the recommendation for https://worldtimebuddy.com https://worldtimebuddy.com - it's a really simple thing it does, but it's somehow the only site/tool I've found that clearly displays the timezones in a way that's easy to understand, including the cross-day issues. It helped a lot for me scheduling meetings between both coasts of the US, India, and Australia. It looks like this tool does a similar kind of display, so definitely worth giving a shot. As for this command, I already had go installed on MacOS through homebrew (although I rarely use it in any form) - and the build went fine and the command runs as expected.
- loloquwowndueo 6y agoVery neat! I normally use https://www.timeanddate.com/worldclock/meeting.html https://www.timeanddate.com/worldclock/meeting.html which has similar functionality but something that works in the command line definitely sounds interesting. I might give it a go (pun intended haha)
- siraben 6y agoI just packaged it in my overlay so Nix users can try it out without installing it (works on macOS and Linux) nix run github:siraben/siraben-overlay#tz or, when it gets upstreamed into Nixpkgs nix run nixpkgs#tz Seems like a useful thing to have so you can visually see when multiple time zones have overlapping daylight! Neat!
- manveru 6y agoThanks, it's always a pleasure to see flakes in the wild. Hope it makes it into nixpkgs soon.
- tantalor 6y agoIs the diagonal white/black separator in the example supposed to indicate something? It appears to suggest something like "night" towards the right, and it lines up with the numbers, but the numbers on either side of it are different, ranging from 10am/11am to 9pm/10pm. Edit: Oh! Is it just showing how the UI appears in dark mode? Then the diagonal is meaningless and distracting!
- curben 6y agoThe diagonal combines light and dark themes' screenshot. Light: https://postimg.cc/BPW3vwJN https://postimg.cc/BPW3vwJN Dark: https://postimg.cc/dkZvwKcL https://postimg.cc/dkZvwKcL
- njt 6y agoI wrote a similar tool based on the idea of choosing cities and "shifting" the time: https://zeitzono.org/ https://zeitzono.org/
- dnrvs 6y agoLooks great! A few years ago I built basically the same thing as a simple web app: https://tz.now.sh/ https://tz.now.sh/
- gkfasdfasdf 6y agoFYI I was able to install using homebrew go (go 1.16.2): go get github.com/oz/tz And it put the tz executable in ~/go/bin Kinda surprised the readme didn't mention it. Is this not the preferred way to install go CLI tools now with 1.16+ ?
- mastre_ 6y agoFYI this works flawlessly on M1 too.
- speakspokespok 6y agoWorldtimebuddy is great but if you're looking for something even better, on Mac you cannot beat 'The Clock' app. Exact same functionality as Worldtimebuddy but goes farther and allows renaming those clocks. If Dan is on EST and Jules is on NRT, rename the EST clock to Dan and the NRT clock to Jules and slide back and forth to easily do the timezone math. If you work for a cloud company and need to schedule cross AZ work this little app will save your life. What is local time in IAD when SYD is doing 10PM maintenance local time? What about NRT? :-)
- hobos_delight 6y agoAwesome work - I ran into an issue with spaces in the TZ_LIST config and sent a PR https://github.com/oz/tz/pull/14 https://github.com/oz/tz/pull/14