md-arif-shaikh / tzc Goto Github PK
View Code? Open in Web Editor NEWTime Zone Converter for Emacs
License: GNU General Public License v3.0
Time Zone Converter for Emacs
License: GNU General Public License v3.0
Thanks for a nice package. I was looking for something like that. Btw, I am from Bengaluru as well. I work as a software developer and continuously used worldtimebuddy.com to schedule meeting across timezones.
Are there any integrations/improvement planned with the emacs inbuilt world-clock? There are two things which I can think of:
The tzc-main-dir
customizable var attempts some good guesses for finding tzdata
files but there is a gap when it is invoked under Termux on Android. Executing the following script demonstrates the issue with querying system-type
alone:
#!/usr/bin/env -S emacs --script
(mapcar
(lambda (sym)
(princ (concat
(symbol-name sym)
":\t"
(let ((symv (symbol-value sym)))
(if (stringp symv)
symv
(symbol-name symv)))
"\n")))
'(system-configuration system-type))
...which, under Termux, prints:
system-configuration: aarch64-unknown-linux-android
system-type: gnu/linux
The challenge is that Android does not follow Linux or macOS convention about splitting up timezone info into multiple files; rather, it offers a single concatenated file:
$ declare -p ANDROID_TZDATA_ROOT
declare -x ANDROID_TZDATA_ROOT="/apex/com.android.tzdata"
$ find "$ANDROID_TZDATA_ROOT" -type f -exec ls -sal --full-time '{}' '+'
find: ‘/apex/com.android.tzdata/lost+found’: Permission denied
4 -rw-r--r-- 1 system system 26 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/apex_manifest.pb
236 -rw-r--r-- 1 system system 237600 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/etc/icu/icu_tzdata.dat
4 -rw-r--r-- 1 system system 248 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/etc/tz/telephonylookup.xml
4 -rw-r--r-- 1 system system 17 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/etc/tz/tz_version
440 -rw-r--r-- 1 system system 449437 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/etc/tz/tzdata
36 -rw-r--r-- 1 system system 36717 1969-12-31 19:00:00.000000000 -0500 /apex/com.android.tzdata/etc/tz/tzlookup.xml
I'm figuring out what to do with this file organization and format in order to offer an actual fix, but for now I'm just opening this issue to log the discovery.
The conversion should take into account the date, i.e. convert the time at a given date, not assume "time as of today".
Today is 2024-03-30
. Los Angeles already changed to summer time, but in Europe the clock will change tomorrow.
Converting the time:
11:00 Europe/Lisbon
M-x tzc-convert-time-at-mark
Selecting America/Los_Angeles
, the result 04:00
is correct.
https://www.timeanddate.com/worldclock/meetingtime.html?day=30&month=3&year=2024&p1=133&p2=137&iv=0
But tomorrow Europe will change clocks to summer time, and for a time next week:
[2024-04-05 Fri 11:00 Europe/Lisbon]
M-x tzc-convert-org-time-stamp-at-mark
[2024-04-05 Fri 04:00 America/Los_Angeles]
Is not correct, the result should be 03:00
.
https://www.timeanddate.com/worldclock/meetingtime.html?iso=20240405&p1=133&p2=137
Hi,
I just downloaded this package and tried to convert between EDT (Easter Daylight Time) 23:00 to IST (India Standard Time) and the result was that they are equal, which is wrong.
Tested on Emacs 27.1
Here's a IELM session:
ELISP> (require 'tzc)
tzc
ELISP> (tzc-convert-time "23:00" "EDT" "IST")
#("23:00 EDT = 23:00 IST" 0 5
(face tzc-face-time-string)
6 9
(face tzc-face-time-zone-label)
12 17
(face tzc-face-time-string)
18 21
(face tzc-face-time-zone-label))
ELISP>
Trying EST (Eastern Standard Time) did not work either:
ELISP> (tzc-convert-time "23:00" "EST" "IST")
#("23:00 EST = 04:00 +1D IST" 0 5
(face tzc-face-time-string)
6 9
(face tzc-face-time-zone-label)
12 17
(face tzc-face-time-string)
17 21
(face tzc-face-date-string)
22 25
(face tzc-face-time-zone-label))
ELISP>
23:00 EDT is 08:30 IST.
When using the package commands to convert times, it took me a few tries until I realized I have to select the time or timestamp.
It would be a helpful convenience if the conversion commands could work "at-point", I think other packages have trained us to expect that behaviour.
Hi,
I just installed tzc, and while configuring it I realized that the time given for UK/London is different to that given for Europe/London, as you can see below from the tzc-world-clock command:
Canarias 09:13 Thu 12 May 2022 +0100
CET 10:13 Thu 12 May 2022 +0200
UTC 08:13 Thu 12 May 2022 +0000
New_York 04:13 Thu 12 May 2022 -0400
London 08:13 Thu 12 May 2022 +0000
London 09:13 Thu 12 May 2022 +0100
Madrid 10:13 Thu 12 May 2022 +0200
Can you please add the UTC timezone? https://en.wikipedia.org/wiki/Coordinated_Universal_Time
When I invoke M-x tzc-convert-current-time-to-favourite-time-zones
the *tzc-wclock*
buffer appears with the times of my favorite time zones, which is great.
However if I invoke it again at a later time, the buffer remains the
same (it will just popup with the old info).
Can it be refreshed instead?
Thanks!
PS. I love this package - I was thinking about attempting to write
something similar about a year ago, but this is far and away better
than anything I would have come up with! So thank you! (This type of
functionality should be built into emacs core imo ;))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.