tzc icon indicating copy to clipboard operation
tzc copied to clipboard

Time Zone Converter for Emacs

#+TITLE: TZC #+AUTHOR: Md Arif Shaikh #+EMAIL: [email protected]

#+html:

GitHub MELPA
  • Table of Contents :TOC:
  • [[#about][About]]
  • [[#installation][Installation]]
  • [[#customization][Customization]]
  • [[#how-to-use-it][How to use it]]
    • [[#convert-a-time-between-time-zones][Convert a time between time zones]]
    • [[#convert-a-time-from-one-zone-to-a-list-of-favourite-time-zones][Convert a time from one zone to a list of favourite time zones]]
    • [[#convert-and-replace-time-at-mark][Convert and replace time at mark]]
    • [[#convert-org-time-stamp][Convert org time stamp]]
    • [[#world-clock][World clock]]
  • About ~tzc~ is a small tool for ~Emacs~ to convert any time from one ~time-zone~ to another ~time-zone~.
  • It supports tzdata database, e.g., ~America/New_York~ specifies the ~time-zone~ and daylight saving time history for locations near New York City. For more details, see the ~time-zone~ rules as described in the ~Emacs~ manual [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Zone-Rules.html][here.]]
  • ~zoneinfo~ could also be any string containg ~+-HHMM~. It also works if the ~timeshift~ is given upto significant places, i. e., without the last digits when it is zero. For example, ~+-HH~ or ~+-HHM~ would work. For example instead of ~Asia/Kolkata~ one can use ~UTC+0530~ or ~UTC+053~ or ~GM+0530~ or ~GM+053~ and so on.
  • A list of all available zones in your system (MacOS (~darwin~) or Linux (~gnu/linux~)) is presented for autocompletion. So you can pick one easily.
  • In the unlikely case where a zone is not available in completion, you can add it to the list ~tzc-favourite-time-zones~.
  • Installation ~tzc~ is available in [[https://melpa.org/#/tzc][MELPA]]. See the instructions [[https://melpa.org/#/getting-started][here]] on how to install a [[https://melpa.org/#/tzc][MELPA]] package. If you use ~use-package~ then the following would work #+BEGIN_SRC emacs-lisp (use-package tzc :ensure t) #+END_SRC
  • Customization You can customize ~tzc-favourite-time-zones-alist~ to set your favourite ~time-zones~ and ~labels~ #+BEGIN_SRC emacs-lisp (setq tzc-favourite-time-zones-alist '(("UTC+0000" "UTC") ("Asia/Kolkata" "Kolkata") ("America/New_York" "New York") ("Europe/London" "London") ("Europe/Berlin" "Berlin") ("Asia/Shanghai" "Shanghai") ("Asia/Tokyo" "Tokyo"))) #+END_SRC
  • How to use it ** Convert a time between time zones To convert a given ~time~ from ~from-zone~ to ~to-zone~, use the interactive function ~tzc-convert-time~. #+html:
    ** Convert a time from one zone to a list of favourite time zones You can set a list of favourite time zones using the variable ~tzc-favourite-time-zones~ and then use the interactive function ~tzc-convert-time-to-favourite-time-zones~ to get the time converted to your favourite time zones. #+html:
    ** Convert and replace time at mark #+html:
    ** Convert org time stamp #+html:
    ** World clock ~tzc-world-clock~ is similar to ~world-clock~ but with the extra feature that with ~n~ (next) or ~p~ ("previous") key it will change the information on the buffer for the next or previous hours. Pressing ~g~ reverts it back to the current time. #+html: