Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for utc #22

Closed
mazinbokhari opened this issue May 31, 2019 · 6 comments
Closed

Add support for utc #22

mazinbokhari opened this issue May 31, 2019 · 6 comments

Comments

@mazinbokhari
Copy link

No description provided.

@geoffreywiseman
Copy link

This is the primary thing I wanted tz for, and sadly, not currently supported. 😭

@jaroslawhartman
Copy link
Owner

jaroslawhartman commented Aug 26, 2019

Hi @mazinbokhari, hi @geoffreywiseman

Could you please describe the usecase? I.e. how the search text should look like?

Thank you,
Jarek

@geoffreywiseman
Copy link

geoffreywiseman commented Aug 26, 2019

So, I often deal with servers that are configured for UTC (configuring servers with UTC as the system time zone is a fairly common practice), but not SO often that UTC conversion is natural to me yet.

So when I'm looking at a log file, I might see a log entry from 14:36 UTC and I'll wonder "What time is that?" and then I'd like to be able to call up Alfred and say "tz utc 14:36" and see what 14:36 UTC is here in my time zone, or possibly in the timezone of another user.

Or I'll want to find something based on my knowledge of when the event occurred, so I might want to find a database record created within a certain time window, which requires me to take times from my time zone (or the timezone of a user) and find out what the UTC equivalent would be. In this case, maybe "tz 09:30" to find out what the UTC equivalent of 9:30 local would be.

@joshka
Copy link

joshka commented Mar 20, 2020

+1 on this, all my server logs are in UTC, but some sites are in my local TZ and I regularly deal with other countries. Making this work out of the box would would make this amazing.

An easy way to implement this (will do when I have some time) would be to just add the Etc/UTC timezones as special locations in the cities csv file (.e.g UTC = Etc/UTC, UTC+1 = Etc/GMT-1 etc.)

A quick workaround that works in the current version is to add a line in the timezone list file like:

UTC|United Kingdom|Etc/UTC|UTC||0|0
UTC+1|United Kingdom|Etc/GMT-1|UTC+1||0|0

See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for Timezones that will work in there - note that the value for Etc/GMT-X is reversed. See
https://en.wikipedia.org/wiki/Tz_database#Area for reasons

@mohoromitch
Copy link

I think the best workaround right now would be to use a city like Reykjavik, which uses GMT (UTC+0) year round. This does bring into question daylight savings time support (which is covered in #34) however, but that's beyond the scope of this issue.

@jaroslawhartman
Copy link
Owner

Added to v2.16:

Screenshot 2020-08-16 at 20 06 27

Screenshot 2020-08-16 at 20 33 47

Will be released soon.

jaroslawhartman added a commit that referenced this issue Aug 16, 2020
16 August 2020
* Pull Request Fix incorrect City -> Country mapping #35
* Converted time copied to Clipboard after hitting Enter
* Added hybrid time format: 24hr (12hr), i.e. 14:30 (2:30 pm). Change using 'timezone both'
* #22, #25: Support for UTC timezone (timezone add utc)
jaroslawhartman added a commit that referenced this issue Nov 3, 2020
2.19
2 November 2020
* #38 - Fix for AoE date - more updates
* #22 - Added more UTC timezones
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants