8.2.1 The date and time prompt
When Org mode prompts for a date/time, the default is shown in default date/time format, and the prompt therefore seems to ask for a specific format. But it in fact accepts date/time information in a variety of formats. Generally, the information should start at the beginning of the string. Org mode finds whatever information is in there and derives anything you have not specified from the default date and time. The default is usually the current date and time, but when modifying an existing timestamp, or when entering the second stamp of a range, it is taken from the stamp in the buffer. When filling in information, Org mode assumes that most of the time you want to enter a date in the future: if you omit the month/year and the given day/month is before today, it assumes that you mean a future date1. If the date has been automatically shifted into the future, the time prompt shows this with β(=>F)
β.
For example, letβs assume that today is June 13, 2006. Here is how various inputs are interpreted, the items filled in by Org mode are in bold.
β3-2-5 β | β 2003-02-05 |
β2/5/3 β | β 2003-02-05 |
β14 β | β 2006-06-14 |
β12 β | β 2006-07-12 |
β2/5 β | β 2007-02-05 |
βFri β | β nearest Friday (default date or later) |
βsep 15 β | β 2006-09-15 |
βfeb 15 β | β 2007-02-15 |
βsep 12 9 β | β 2009-09-12 |
β12:45 β | β 2006-06-13 12:45 |
β22 sept 0:34 β | β 2006-09-22 0:34 |
βw4 β | β ISO week for of the current year 2006 |
β2012 w4 fri β | β Friday of ISO week 4 in 2012 |
β2012-w04-5 β | β Same as above |
Furthermore you can specify a relative date by giving, as the first thing in the input: a plus/minus sign, a number and a letterββd
β, βw
β, βm
β or βy
ββto indicate change in days, weeks, months, or years. With a single plus or minus, the date is always relative to today. With a double plus or minus, it is relative to the default date. If instead of a single letter, you use the abbreviation of day name, the date is the Nth such day, e.g.:
β+0 β | β today |
β. β | β today |
β+4d β | β four days from today |
β+4 β | β same as +4d |
β+2w β | β two weeks from today |
β++5 β | β five days from default date |
β+2tue β | β second Tuesday from now |
The function understands English month and weekday abbreviations. If you want to use un-abbreviated names and/or other languages, configure the variables parse-time-months
and parse-time-weekdays
.
Not all dates can be represented in a given Emacs implementation. By default Org mode forces dates into the compatibility range 1970β2037 which works on all Emacs implementations. If you want to use dates outside of this range, read the docstring of the variable org-read-date-force-compatible-dates
.
You can specify a time range by giving start and end times or by giving a start time and a duration (in HH:MM format). Use one or two dash(es) as the separator in the former case and use β+
β as the separator in the latter case, e.g.:
β11am-1:15pm β | β 11:00-13:15 |
β11am--1:15pm β | β same as above |
β11am+2:15 β | β same as above |
Parallel to the minibuffer prompt, a calendar is popped up2. When you exit the date prompt, either by clicking on a date in the calendar, or by pressing RET
, the date selected in the calendar is combined with the information entered at the prompt. You can control the calendar fully from the minibuffer:
RET | Choose date at point in calendar. |
mouse-1 | Select date by clicking on it. |
S-RIGHT | One day forward. |
S-LEFT | One day backward. |
S-DOWN | One week forward. |
S-UP | One week backward. |
M-S-RIGHT | One month forward. |
M-S-LEFT | One month backward. |
> | Scroll calendar forward by one month. |
< | Scroll calendar backward by one month. |
M-v | Scroll calendar forward by 3 months. |
C-v | Scroll calendar backward by 3 months. |
C-. | Select todayβs date3 |
The actions of the date/time prompt may seem complex, but I assure you they will grow on you, and you will start getting annoyed by pretty much any other way of entering a date/time out there. To help you understand what is going on, the current interpretation of your input is displayed live in the minibuffer4.
- See the variable
org-read-date-prefer-future
. You may set that variable to the symboltime
to even make a time before now shift the date to tomorrow.β© - If you do not need/want the calendar, configure the variable
org-popup-calendar-for-date-prompt
.β© - You can also use the calendar command
.
to jump to todayβs date, but if you are inserting an hour specification for your timestamp,.
will then insert a dot after the hour. By contrast,C-.
will always jump to todayβs date.β© - If you find this distracting, turn off the display with
org-read-date-display-live
.β©