Jump to content

TimeZones - a World Clock script filter [updated to v1.7]


Recommended Posts

Any way to configure this so that I can see times in 24-hour clock?

 

I ended up modifying the script myself. In timezone_list.sh

<       city_time=$(date -u -j -f %s $city_epochtime +"%T") #Create readable time expression
---
>       city_time=$(date -u -j -f %s $city_epochtime +"%l:%M %p") #Create readable time expression
157c157

Note the %l:%M %p was changed to  simply %H:%M

Edited by drwatson
Link to comment

Hi Carlos, Thanks for your workflow. I saw a little discussion about DST in the posts. Any chance you'll add that? For instance, it says it's 10:30pm here in New York, but it's 9:30pm.

 

Paul

Hi Paul, hope you've figured it out by now, but you'll just need to run "timezone update" on the workflow to force it refresh its local offset database. It should show the correct time (DST or normal) after that.

 

Carl

Link to comment

I ended up modifying the script myself. In timezone_list.sh

<       city_time=$(date -u -j -f %s $city_epochtime +"%T") #Create readable time expression
---
>       city_time=$(date -u -j -f %s $city_epochtime +"%l:%M %p") #Create readable time expression
157c157

Note the %l:%M %p was changed to  simply %H:%M

Yeah, good, that's what I was going to suggest. I think there's already a couple of posts regarding that further up in this thread.

 

Cheers,

Carl.

Link to comment
  • 5 months later...

Timezones has stopped working for me.  I am not sure if it has to do with El Capitan or Alfred 3.   Anyone else experiencing issues?  When I run "timezones update" the resulting timezones file for my cities have all of their timezones set to  "UTC+".  Did El Capitan change the output for the "date" comment in the shell?

Link to comment

I uninstalled, downloaded again, and reinstalled.  Alfred 2 locations are hard-coded, so I updated update.sh for Alfred 3.  All is well.

 

Hi Duffetta, could you please tell me how to update "update.sh" for Alfred 3? I installed TimeZones for Alfred 3, but it doesn't work as well as in Alfred 2. Thank you!

Link to comment
  • 4 weeks later...

Hi Duffetta,same here please,it's stopped working for me on Alfred 3. Can't see the list of my added cities..

 

 

Hi Plant. I solved the problem. If you still need the solution, please try this way. 

 

1. Open the workflow in finder.

2. Find and open the file "includes.sh".

3. Change Alfred-2 to Alfred-3 and Alfred 2 to Alfred 3 in the following lines.

TZWD="$HOME/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/carlosnz.timezones"

TZPREFS="$HOME/Library/Application Support/Alfred 2/Workflow Data/carlosnz.timezones"
 
Now you will see the workflow works as well as in Alfred 2.
Edited by VALVESSELLER
Link to comment

 

Hi Plant. I solved the problem. If you still need the solution, please try this way. 

 

1. Open the workflow in finder.

2. Find and open the file "includes.sh".

3. Change Alfred-2 to Alfred-3 and Alfred 2 to Alfred 3 in the following lines.

TZWD="$HOME/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/carlosnz.timezones"

TZPREFS="$HOME/Library/Application Support/Alfred 2/Workflow Data/carlosnz.timezones"
 
Now you will see the workflow works as well as in Alfred 2.

 

 

 

Apologies for not having picked up your questions.  I don't visit the Alfred Forums often and I didn't get notified of the activity on this thread. <sigh>

 

Exactly.  Just need to have a look at all of the shell scripts and make sure that the paths are correct.  There may be environment variables available in the shell that Alfred starts up that would point to these places more generically, so the paths wouldn't need to be hard coded in those shell scripts.  I haven't investigated this at all.  Just a guess (hope?)

 

Glad that you were able to figure it out.

 

BTW, Thanks @CarlosNZ for a nice solution to the multiple timezone problem, for those of us who work in multiple timezones.

 

Mark

Link to comment

Apologies for not having picked up your questions.  I don't visit the Alfred Forums often and I didn't get notified of the activity on this thread. <sigh>

 

Exactly.  Just need to have a look at all of the shell scripts and make sure that the paths are correct.  There may be environment variables available in the shell that Alfred starts up that would point to these places more generically, so the paths wouldn't need to be hard coded in those shell scripts.  I haven't investigated this at all.  Just a guess (hope?)

 

Glad that you were able to figure it out.

 

BTW, Thanks @CarlosNZ for a nice solution to the multiple timezone problem, for those of us who work in multiple timezones.

 

Mark

 

Hi, many thanks for taking time checking the issue here. At first, i had to install both Alfred 2 & 3 for the workflow to work well in Alfred 3. Yes, this workflow helps a lot. 

 

Regards

Link to comment
  • 2 months later...

 

Hi Guys

 

I am unable to find the "includes.sh" file in the Finder - all I can view is files named "config 1-5" and "timezones.txt" - I am using the latest V1.7 also.

 

Would appreciate help.

 

Kind Regards
Paul

 

Hi Paul, in Alfred, if you right-click on the workflow (in the Workflows tab), then select "Open in Finder", it'll take you the unpacked workflow in Alfred. the includes.sh file is in there.

 

Cheers,

Carl.

Link to comment
  • 1 month later...

Hi, 

 

Great tool, however as mentioned earlier, it's missing update to Alfred 3.

 

Attached version compatible with Alfred 3 and one more enhancement:

 

You can enter "tz <time>" in formats HH, HHMM or HH:MM to convert this time to your pre-defined time zones:

tz.png

 

You can download this version from http://jhartman.webd.pl/files/TimeZones Enhanced.zip (see below for updated version).

 

Feel free to merge this feature to the official release (changed file: timezone_list.sh).

 

Best regards,

Jarek

Edited by Jarek
Link to comment
  • 1 month later...
On 11/23/2016 at 3:03 PM, mesqueeb said:

Can I make it so the time's show in 24:00 time format instead of AM PM?

Cheers!

 

Thanks for motivating me for changing it, I also prefer 24-hrs format:

 

tz2.png

 

New version in http://jhartman.webd.pl/files/TimeZones Enhanced v2.zip (see below for updated version).

 

PS: I've noticed that the tool does not switch DST (e.g. CET <-> CEST) so you need to force update through 'timezone update' keyword.

 

Edited by Jarek
Link to comment

Use the workflow often, I was wondering if there was a way to integrate seeing the call codes for the country as well? Lets say im looking up the timezone for Australia - can I get the country's calling code (+61)? Any help on how I can do it myself will be appreciate too :) 

Link to comment
  • 3 weeks later...
On 11/28/2016 at 7:53 AM, Neil D. said:

Use the workflow often, I was wondering if there was a way to integrate seeing the call codes for the country as well? Lets say im looking up the timezone for Australia - can I get the country's calling code (+61)? Any help on how I can do it myself will be appreciate too :) 

 

Hi Neil,

 

You owe me a beer.... at least - a half. A few more updates and:

 

TZ with CC.png

 

Unfortunately, for some countries it does not work but I don't have time tonight to troubleshoot...

 

After installing v1.8 run "timezone update" or remove + add all defined cities.

 

Cheers,

Jarek

 

 

http://jhartman.pl/files/Alfred time-zones v1.8.zip

Edited by Jarek
Link to comment
On 14/12/2016 at 4:09 AM, Jarek said:

Hi Neil,

 

After installing v3 run "timezone update" or remove + add all defined cities.

 

Cheers,

Jarek

Hey Jarek,

 

Damn you work fast! Thanks for the awesome edit! I downloaded it and followed your instructions, it works great.

I really really appreciate the help. Lmk where to send the beer. You're the best :)

 

Best Regards,

Neil

Link to comment

There is a problem where I don't really have a good idea how to fix: some countries (e.g. USA or UK, see the previous screenshot) does not have phone country code.

 

Easiest way to fix is to open terminal app, execute:

open "$HOME/Library/Application Support/Alfred 3/Workflow Data/carlosnz.timezones/timezones.txt"

and add country code manually, after the pipe, e.g.

 

Los angeles|Los Angeles|United States|34.0522342|-118.2436849|-28800|America/Los_Angeles|Pacific Standard Time|UTC-8|1
london|London|United Kingdom|51.5073509|-0.1277583|0|Europe/London|Greenwich Mean Time|UTC+0|44

Save the file.

 

Cheers

Link to comment
  • 4 weeks later...
  • 2 months later...
1 hour ago, Berti said:

great workflow! 

 

I found, however, that the times aren't accurate when a country is switching to a different time zone (see the attached screenshot).

 

 

Screenshot 2017-03-27 12.38.57.png

 

Unfortunately, this is "known issue" ☺️ Invoke "timezone update" to get all your defined locations up to date. And not forget doing it again in 6 months ☺️

 

Best regards, Jarek 

Link to comment
1 minute ago, Jarek said:

 

Unfortunately, this is "known issue" ☺️ Invoke "timezone update" to get all your defined locations up to date. And not forget doing it again in 6 months ☺️

 

Best regards, Jarek 

Yeah, it's the price you pay for speed. I could have it look up the true time difference every single run, but that wouldn't give instant results.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...