Create a Google Calendar event from an Org Mode timestamp
| org, emacsTime zones are hard, so I let calendaring systems take care of the conversion and confirmation. I've been using Google Calendar because it synchronizes with my phone and people know what to do with the event invite. Org Mode has iCalendar export, but I sometimes have a hard time getting .ics files into Google Calendar on my laptop, so I might as well just create the calendar entry in Google Calendar directly. Well. Emacs is a lot more fun than Google Calendar, so I'd rather create the calendar entry from Emacs and put it into Google Calendar.
This function lets me start from a timestamp like [2026-04-24 Fri 10:30] (inserted with C-u C-c C-!, or org-timestamp-inactive) and create an event based on a template.
(defvar sacha-time-zone "America/Toronto" "Full name of time zone.")
;;;###autoload
(defun sacha-emacs-chat-schedule (&optional time)
"Create a Google Calendar invite based on TIME or the Org timestamp at point."
(interactive (list (sacha-org-time-at-point)))
(browse-url
(format
"https://calendar.google.com/calendar/render?action=TEMPLATE&text=%s&details=%s&dates=%s&ctz=%s"
(url-hexify-string sacha-emacs-chat-title)
(url-hexify-string sacha-emacs-chat-description)
(format-time-string
"%Y%m%dT%H%M%S" time)
sacha-time-zone)))
(defvar sacha-emacs-chat-title "Emacs Chat" "Title of calendar entry.")
(defvar sacha-emacs-chat-description
"All right, let's try this! =) See the calendar invite for the Google Meet link.
Objective: Share cool stuff about Emacs workflows that's not obvious from reading configs, and have fun chatting about Emacs
Some ideas for things to talk about:
- Which keyboard shortcuts or combinations of functions work really well for you?
- What's something you love about your setup?
- What are you looking forward to tweaking next?
Let me know if you want to do it on stream (more people can ask questions) or off stream (we can clean up the video in case there are hiccups). Also, please feel free to send me links to things you'd like me to read ahead of time, like your config!"
"Description.")
It uses this function to convert the timestamp at point:
sacha-org-time-at-point: Return Emacs time object for timestamp at point.
(defun sacha-org-time-at-point () "Return Emacs time object for timestamp at point." (org-timestamp-to-time (org-timestamp-from-string (org-element-property :raw-value (org-element-context)))))