12 votes
Accepted

Change date from active to inactive

TL;DR; From the keyboard (in org-mode): C-c . to activate (convert from inactive to active). C-c ! to inactivate (convert from active to inactive). From lisp: (org-time-stamp t) to activate, ...
Realraptor's user avatar
  • 1,283
11 votes
Accepted

Counting the number of days that have passed since a certain date

I write "<2016-06-15 Wed>--<2016-07-18 Mon>" ...and then (with POINT somewhere over the dates) I press C-c C-y (org-evaluate-time-range) C-ucy will write the time-range after the dates like, &...
vcmsxs's user avatar
  • 451
11 votes
Accepted

org column view with date calculations

The Org syntax for the DEADLINE event differs from what you use in your question. Instead of * TODO fix this bug asap :PROPERTIES: :UPDATE: writing test cases almost there! :LASTUPDATED: 2019-11-25 :...
Tobias's user avatar
  • 33.2k
9 votes

Convert Unix time to Org-mode timestamp

As lawlist mentioned in the comment, running the following in your own Emacs will return what you want (format-time-string "<%Y-%m-%d %a %H:%M:%S>" (seconds-to-time 1523473110)) ;; => "<...
xuchunyang's user avatar
  • 14.5k
7 votes
Accepted

How to subtract time values formatted as "HH:mm"?

This way I get the error Invalid time specification. OK. Maybe I need to encode times first: Indeed. Now I get the error Wrong type argument: fixnump, nil. This is because parse-time-string is ...
Basil's user avatar
  • 12.4k
7 votes
Accepted

Display relative dates in org-mode property drawers

The command org+-dateprop defined in the following Elisp code does what you want. It puts overlays with a display property on the absolute dates that shows the relative dates instead. This has the ...
Tobias's user avatar
  • 33.2k
6 votes

Show time in different time zones

I start typing different keywords in M-x and see completion to: display-time-world That is mostly what I look for: display-time-world is an interactive autoloaded compiled Lisp function in `time.el'...
gavenkoa's user avatar
  • 3,452
6 votes

Counting the number of days that have passed since a certain date

The original poster may wish to have a look at the built-in function called calendar-count-days-region described in the manual: https://www.gnu.org/software/emacs/manual/html_node/emacs/Counting-Days....
lawlist's user avatar
  • 19.1k
6 votes
Accepted

Insert an arbitrary timestamp

To insert a timestamp four months from today, press: C-c . +4m RET and the +4m cookie shifts the date for you. Likewise, use -4m to insert four months before today (y, m, w, and d letters are all ...
jagrg's user avatar
  • 3,914
5 votes
Accepted

How can I convert a list of integers to a string?

You can use the apply function to pass a function arguments contained in a list as separate arguments. For example: (apply #'format "%04d-%02d-%02d" '(2017 8 21)) That way you can store the list in ...
Omar's user avatar
  • 4,812
5 votes

How do I interconvert Calc's HMS forms and seconds?

One way of going from an HMS form to the number of seconds is hinted by a line from the HMS forms page: Dividing two HMS forms produces a real-valued ratio of the two angles. So if an HMS form is ...
G. D. McBain's user avatar
5 votes

In elisp, how can I calculate the number of days remaining until a given date?

Found it. It's org-time-stamp-to-now.
Jonathan's user avatar
  • 597
5 votes
Accepted

How to add a time and a time interval in calc-mode?

To input a value in non-standardized HMS form you can press ' to start algebraic entry and then use the hms function. For example, to enter the equivalent of 0@8000'0" you would type ' hms(0, 8000, 0) ...
martin_joerg's user avatar
5 votes

Table formula for dates delta

Solution with calc hms duration strings If you are a bit more flexible with the duration format you can use the hms form of calc. The advantage is that you can further process these values with calc ...
Tobias's user avatar
  • 33.2k
5 votes
Accepted

Inserting timestamp in mini buffer in Emacs

I have the following in my .emacs: ;; date (global-set-key "\C-\M-d" (lambda (arg) (interactive "P") (let ((separator (pcase arg ('(4) "-") ...
choroba's user avatar
  • 2,045
5 votes
Accepted

How to compare date strings?

Convert the date strings to time values, then use time-less-p to compare the time values. C-h f time-less-p: time-less-p is a built-in function in ‘C source code’. (time-less-p T1 T2) Return non-nil ...
Drew's user avatar
  • 77.5k
4 votes

Show sum of efforts for a day in Org-Agenda day title

So far as I know, this is not possible. You can get an effort sum using column view, though only for one day at a time. Set column format as follows: (setq org-columns-default-format "%60ITEM(Task) %...
hartshoj's user avatar
  • 497
4 votes
Accepted

Convert between ISO week and a normal date

Base on your own answer, here is another way to do it. (require 'cal-iso) (defun iso-week-to-time (year week day) (pcase-let ((`(,m ,d ,y) (calendar-gregorian-from-absolute ...
xuchunyang's user avatar
  • 14.5k
4 votes

Table formula for dates delta

Borrowing the answer from SE -> https://stackoverflow.com/a/17681657/8544157 And adapting @juanleon 's answer to your structure, (you will need to add column 6): #+TBLFM: $5=date(<$3>)-date(&...
manandearth's user avatar
  • 2,118
4 votes

Apply different function to each element in list?

I think you've overcomplicated the problem. You're obtaining a list comprising hours, minutes, seconds, and microseconds, so I think your code would be simpler and more readable if you expressed that ...
phils's user avatar
  • 51.1k
4 votes
Accepted

How to insert the current date into a file using abbrev or similar?

You need to remove the parenthesis from your custom function. It's calling for hook function name there, not its evaluation. (define-abbrev-table 'global-abbrev-table '(("td" "" insert-current-iso-...
Muihlinn's user avatar
  • 2,624
4 votes
Accepted

How to create humanly readable delta between two times?

Here's one way: (defun my-format-time-delta (time1 time2) "Return difference between TIME1 & TIME2 as a readable string." (format-seconds "%Y %D %H %M %z%S" (float-time (...
Basil's user avatar
  • 12.4k
3 votes
Accepted

Convert a timestamp to local time

parse-iso8601-time-string already returns a time value that format-time-string accepts: (format-time-string "%Y-%m-%dT%H:%M:%S%z" (parse-iso8601-time-string "2011-01-23T16:18:46-08:00")) => ...
xuchunyang's user avatar
  • 14.5k
3 votes

Multiple Scheduled Timestamps for One Task

I think org habits is suitable for this task. Otherwise I actually don't see any problem with your current approach. They can indeed be regarded as three separate tasks anyways, since they're quite ...
xji's user avatar
  • 2,635
3 votes

Current time timestamp in org-capture-templates

According the help for org-agenda-capture (bound to k in agenda views) Call ‘org-capture’ with the date at point. With a ‘C-1’ prefix, use the HH:MM value at point (if any) or the current HH:MM ...
erikstokes's user avatar
  • 12.9k
3 votes

Show sum of efforts for a day in Org-Agenda day title

You can accomplish this by defining a function such as my/org-agenda-insert-efforts that inserts the sum of the efforts next to the heading for a particular day after the agenda has been generated. ...
anpandey's user avatar
3 votes
Accepted

I cannot manually edit date fields before closing bracket in org-mode buffer

Have you enabled org-toggle-time-stamp-overlays via C-c C-x C-t? With this enabled you cannot place the cursor onto a timestamp anymore, only before or after.
Bae's user avatar
  • 222
3 votes

Specify timezone in Org date format

Note: this only stores the local timezone and keep it in your timestamps. It'll replace any timezone information by your local one. But at least it'll store your current local one. Note2: all ...
vaab's user avatar
  • 315
3 votes
Accepted

How to retrieve the date under the cursor in emacs calendar as the format day.month.year like 15.07.2018

The following code augments the key sequence M-w such that it copies the date below point with the format "%d.%m.%Y when region is not active ( %d: zero padded day, %m: zero-padded month, %Y: year). ...
Tobias's user avatar
  • 33.2k
3 votes
Accepted

test if a file has been updated within the current day

Here's a function that compares today's date with the last modification date of FILE. If both strings are equal, return t. (defun file-updated-today-p (file) (string= (format-time-string "%F") ...
jagrg's user avatar
  • 3,914

Only top scored, non community-wiki answers of a minimum length are eligible