Suppose I'd like to set a task for tomorrow for me to check if a cron job of mine ran at the proper time.

So, I add to my org file:

** TODO check if cronjob has run at 5:00
SCHEDULED: <2018-12-03 Mon>

However, this is output in my agenda as:

5:00...... Scheduled: TODO check if cronjob has run at

which is not quite what I expected, which would be, for this particular task to be shown in the agenda scheduled for 2018-12-03, but with no particular time associated with it. Also the time "5:00" should not be stripped from the heading.

Org's documentation states that:

A timestamp can appear anywhere in the headline or body of an Org tree entry.

However, my "5:00" does not obey the timestamp syntax (no <> or []).

Is there an "opt-out" of this behavior from Org to get timestamp information from heading content? Or am I missing something here?

I'm using Org version 9.1.14 (up to date org-plus-contrib from http://orgmode.org/elpa/).

  • Please say more clearly how the output in your example differs from what you expected. – Heikki Dec 3 at 5:35
  • The org-mode version might affect the answer. What version are you using? – Heikki Dec 3 at 7:45
up vote 2 down vote accepted

Best way of finding configurable variables is to look into the source code. In this case, the org-agenda.el file contains this:

(defcustom org-agenda-search-headline-for-time t
       "Non-nil means search headline for a time-of-day.
     If the headline contains a time-of-day in one format or another, it will
     be used to sort the entry into the time sequence of items for a day.
     Some people have time stamps in the headline that refer to the creation
     time or so, and then this produces an unwanted side effect.  If this is
     the case for your, use this variable to turn off searching the headline
     for a time."
       :group 'org-agenda-time-grid
       :type 'boolean)

Setting it to nil with

(setq org-agenda-search-headline-for-time nil)

changes my agenda view to this:

todo:       Scheduled:  TODO check if cronjob has run at 5:00

However, it also disables the time grid and I can not figure out how to get that back. The variable org-agenda-time-grid is unchanged. This is on Org mode version 9.1.14.

  • Heikki, that's the one! Thank you very much! And I do get the timegrid. I'm also using version 9.1.14 (up to date org-plus-contrib), but do have in my init file to show it always for today. – gusbrs Dec 3 at 9:18
  • Btw, I am in the habit of looking the code (though much of it eludes me). And, in this case, I screened the org-customize tree. I also looked at the section for Dates and times in the documentation (as it turns out, the option is described later in Agenda views). That's just to say I tried, but I couldn't find it. – gusbrs Dec 3 at 9:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.