Intro
The workflow has been created by Mr Carlos from New Zealand and published on the Alfred Forum. I’ve enhanced the workflow by adding a few new functionalities:
- Converting any time to all pre-defined time zones
- Enabling 24-hrs time format
- Displaying phone country code
After all it looks like below:
Conversion of a time in your local time to your pre-defined time-zones – “tz ” in formats HH, HHMM or HH:MM:
Conversion of a time in a timezone from your list (Warsaw in the sample) with modified date (plus 3 days in the sample):
Commands
- Keyword: tz (or hotkey) – bring up the list of saved cities with their respective current times. (Keep typing the name of a place for a one-off lookup.)
- Keyword: tz [part of city name] – searches for a city in your cities that matches that name and shows the current time.
- Keyword: tz [
time
] – (wheretime
is HH, HHMM or HH:MM) – convert provided time into the time of your cities. - Keyword: tz [
date modifier
] [time
] – (wheretime
is as above anddate modifier
is ‘today’ (short: ‘t’), or ‘tomorrow’ (short: ‘tm’), or[number of days]d
what means to add the number of days to current date, or one ofdd
,mmdd
,yymmdd
,yyyymmdd
to give an absolute date) – convert provided date and time into time of your cities. - Keyword: tz [
source city
] [date
] [time
] – (wheretime
anddate
are as above andsource city
is used to search in your city list) – assumes that date and time is given in the timezone of provided source city and converts it into time of your (other) cities. - Keyword: timezone add [your city] – add your city to the list. (To remove a city, option-select it from the main list.)
- Keyword: timezone edit – open for edit of cities file.
- Keyword: timezone move – move the saved cities file (timezones.txt) to a location of your choice (so you can sync it in your Dropbox or whatever you want).
- Keyword: timezone 12h, timezone 24h – change format of displayed time.
- Configurable 12h/24h format. Keywords to switch “timezone 24h”, “timezone 12h”.
- Support for UTC timezone (timezone add utc)
Keyboard shortcuts to add, remove or mark as a favourite
Installation steps
- Install Alfred
- Purchase premium version of Alfred to enable Workflows
- Download latest ZIP file from GitHub releases page
- Unzip and double click to add to Alfred
References
- Project stored in GitHub https://github.com/jaroslawhartman/TimeZones-Alfred
- GeoIP2 City and Country CSV Databases: https://dev.maxmind.com/geoip/geoip2/geoip2-city-country-csv-databases/
- Flag icons from: http://www.free-country-flags.com (Creative Commons Attribution-ShareAlike 3.0 Unported License.)
- Icon design by Logo Open Stock (modified from original) http://www.logoopenstock.com
Support
Your support on Buy Me a Coffee is invaluable, motivating me to continue crafting bytes that matters – thank you sincerely!
Time Zones for Alfred
Great work man! Thank you
Thanks, but in fact, all the credit needs to go to Carlos 🙂
Cheers
Thanks for the workflow. Great stuff.
I’m glad you like it!
Regards, Jarek
Pingback:Time Zones v1.8 in GitHub (Alfred workflow)
Hi there
Since upgrading to Mac High Sierra, the extension opens a Chrome window everytime it’s called.
Would you know what the cause is?
regards
Johnathan
Turned out to be an overlap with an other workflow (using ‘t’ as its keyword).
Seems to not be working right. tz opens chrome and I only have 3 other workflows non of which start with “tz”
Also: how to add default cities?
Hi Jonathan,
Can you try disable all other workflows to see if this will help? I really don’t see any reason to open Chrome by this workflow.
Please try
timezone add
to add new city to the list.Best regards,
Jarek
Hi, Jarek!
After DST change, I’ve tried to do a manual `timezone update` but it fails, and it logs the following error:
`[2018-11-02 11:00:00][ERROR: action.script] ./update.sh: line 3: /usr/local/bin/growlnotify: No such file or directory`
I can see that `growl` is a paid notification system. Maybe it is a good idea to remove this dependency?
Regards,
Serghei
Hi Serghei,
Ah! I’ve overlooked it. Will remove.
Raised a ticket in GitHub: https://github.com/jaroslawhartman/TimeZones-Alfred/issues/5
Thanks for reporting!
Download is a zip file that extracts to shell scripts, no .alfredworkflow in sight?
Thank you Johnathan, fixed now.
Awesome. Thank you Jarek. Really good work. I use the workflow all the time!
Jarek. I seem to remember the workflow used to support something like “tz Berlin” where Berlin isn’t in the list of shortcuts.
So “tz” would query any city we put to it.
Can that functionality be restored?
Yeah, I think this is very next enhancement on my list… Registered as #6 https://github.com/jaroslawhartman/TimeZones-Alfred/issues/6
Best regards,
Jarek
Hey Jarek –
Love the workflow. Thank you for building it. I am having trouble ordering the list of cities in the ‘timezones.txt’ file using the ‘timezone edit’ command in the workflow. It will not save my changes, as I want the order of the cities to be in order from west to east.
Thoughts?
Hi Austin,
The script will always sort the list alphabetically, taking in account also your “favourite” cities. Here “favourite” means – pinned to the top of the list. To add or remove from fav list, press Command+Enter while on the list.
If you really want to skip the sorting, go to
timezone_list.sh
and remove sorting part from line 123 to be something like:done < "$timezone_file"
I hope it will help,
Jarek
Worked like a charm. Thanks so much!
Where is this pulling the time from? It doesn’t seem to have updated to Daylight Savings time. My times are an hour off and I can’t figure out how to correct it.
I love this app, since my daughter is overseas, but I only just realized it was using the wrong times.
Thanks
Hi Steve,
I must say that this issue is a big surprise to me – DST change supposed to be “automatic”.
I will be back home from my holidays on the 18th of Feb. Will take a look.
Would you be so kind and raise a new issue report on github at https://github.com/jaroslawhartman/TimeZones-Alfred/issues
Thank you
Hi Jarek,
I went to the latest release and reinstalled. That seems to have fixed the problem. I think it was actually an update, since some other things have changed. I’m sorry to have bothered you about it, and should have spent a little longer thinking it through.
Enjoy your holiday. sorry for interrupting it.
Good to hear it’s resolved. I hope it was something related to this old version and not a hidden bug
Best regards, Jarek
Hi, I just upgraded to Alfred 4. And I found that timezone workflow doesn’t work anymore.
Hi Tyler,
Please download v2.7 from https://github.com/jaroslawhartman/TimeZones-Alfred/releases
I hope it will work better.
Thank you,
Jarek
Thanks so much – what a great tool!
Thanks Michael!
It would be nice to give some examples to add a place in the world.
I didn’t find anything. When you’re not a developer, how do you use it?
Thanks
Best if you go to https://github.com/jaroslawhartman/TimeZones-Alfred
Regards!
How do i use this with oneupdater?
I like this, but why can’t I remove or mark as a favourite? After clicking Option + Enter or Command + Enter , it quits directly, It doesn’t work.
This has been fixed, please check the latest version.
Regards!
Hi. I need this.
After I downloaded it only showed New York, London, Warsaw and New Dehli
Am I missing something? It’s like it’s a demo?
Thanks in advance
Hi there, what a great tool! Thank you so much for setting. I’m having issues, I can’t convert at all, it immediately goes to fall back search when I try entering a time that is not listed. Help please?
I am on the newest Mac OS 14.0.