It's easy to do date arithmetic using org-mode table formulas. For example, if I enter this table:
| [2020-01-01] | |
| [2020-02-01] | |
| [2020-03-01] | |
#+TBLFM: $2=$1+1
...and then do C-c C-c
on the formula, the table updates column 2, adding one day to the dates in column 1.
Can this be done using a Lisp formula instead of a calc formula? If so, how?
I see in the org-mode manual that Lisp formulas support various trailing flags to interpret the table cells in different formats, but not datestamps. I experimented with calc-eval
, but calc datestamps differ in format from org datestamps. It appears there's some invisible plumbing that connects the two.
(org-format-time-string "[%F]" (org-time-from-absolute (1+ (org-time-string-to-absolute "[2020-01-01]"))))