md-arif-shaikh / tzc

Time Zone Converter for Emacs
GNU General Public License v3.0
18 stars 1 forks source link

Missing support UTC timezone #1

Closed alexmurray closed 2 years ago

alexmurray commented 2 years ago

Can you please add the UTC timezone? https://en.wikipedia.org/wiki/Coordinated_Universal_Time

md-arif-shaikh commented 2 years ago

Hi @alexmurray, thanks for this. Just to understand it more clearly, do you want to use offsets in the form of UTC+-HH:MM? Currently, it will work if you give UTC+-HHMM or in fact just HHMM as your zone input. Let me know if you still think I should include UTC+-HH:MM format. To be honest it would be trivial to support this but just wanted to check what you mean before I do so.

Also, would you prefer an option to choose which format to use?

alexmurray commented 2 years ago

I meant actually just having UTC in the list of supported / known timezones - so that say you could convert to/from a particular timezone to/from UTC.

md-arif-shaikh commented 2 years ago

Ah, I see. I can definitely do that. FYI, you can also do this by setting the tzc-favourite-time-zones variable. Like

(setq tzc-favourite-time-zones '("UTC+0000" "Asia/Kolkata" "America/New_York"))
md-arif-shaikh commented 2 years ago

Hi @alexmurray, could you let me if the last commit fixed the issue for you?

md-arif-shaikh commented 2 years ago

I am closing this assuming it is no longer an issue. Feel free to reopen if it does not work for you.

alexmurray commented 2 years ago

Apologies I haven't had a chance to check on this, will let you know. Thanks again for the quick response.

md-arif-shaikh commented 2 years ago

Hi @alexmurray, I forgot to mention that there has been a change in the way you can set your preferred zones, it is now an alist where each element is of the form ('zone-info' 'label'). For example, you can add UTC by setting

(setq tzc-favourite-time-zones-alist '(("UTC+0000" "UTC") ("Asia/Kolkata" "Kolkata"))

or simply

(setq tzc-favourite-time-zones-alist '(("+0000" "UTC") ("Asia/Kolkata" "Kolkata"))
alexmurray commented 2 years ago

Thanks - yep this works great.