You can use the copyright-update function. I would read the docs for the function. and others inside copyright.el for more info, but as a simple example, If I have:
;; Copyright (C) 2014, Jordon Biondo
in a file and run copyright-update from the minibuffer, it updates the line to say
;; Copyright (C) 2014, 2015, Jordon Biondo
You can have the function ...
From the keyboard (in org-mode):
to activate (convert from inactive to active).
to inactivate (convert from active to inactive).
to activate, and
(org-time-stamp t t)
Edit: As Juancho points out, <S-up> and <S-down> both toggle between active and inactive timestamps.
Emacs's built-in date parser is parse-time-string in parse-time.el, called by date-to-time. It understands English month and weekday names and several combinations of elements in various orders, but not expressions like “next Wednesday”.
The date input formats in the GNU date command provided on non-embedded Linux and Cygwin are implemented in the source of ...
From the documentation of org-time-stamp:
With two universal prefix arguments, insert an active timestamp
with the current time without prompting the user.
So eval the below:
(org-time-stamp '(16) t)
'(4) - one prefix arg (4)
'(16) - two prefix args (4 * 4)
'(64) - three prefix args (4 * 4 * 4)
To read more about the universal arguments and ...
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, <2016-06-15 Wed>--<2016-07-18 Mon> 33d
Internally, org-mode uses the function org-read-date to do this:
(org-read-date &optional ORG-WITH-TIME TO-TIME FROM-STRING PROMPT
DEFAULT-TIME DEFAULT-INPUT INACTIVE)
(org-read-date nil nil "16 February 2015")
returns "2015-02-16". This doesn't put in the "<>" or "" for active/inactive time-stamps, but you can easily add them with ...
The top of the EmacsWiki page on Display Time tells you how to control the format of the time.
Of the three variables, it looks like display-time-format is the most relevant after inspecting the docstrings of the variables with C-h v display-time-format:
String specifying format for displaying the time in the mode line.
See the function format-time-...
You need to define the variable org-time-stamp-custom-formats, not to call a function. What you type after the variable name and colon is a value (what you might type after ').
-*- org-time-stamp-custom-formats: ("<%Y-%m>" . "<%Y-%m-%d %H:%M>") -*-
# Local Variables:
# org-time-stamp-custom-formats: ("<%Y-%m>" . "<%Y-%m-%d %H:%M>...
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 advantage that the buffer contents is not modified by the function.
But, it may be a disadvantage that dates are not exported as shown but as absolute dates.
Time zone informatian is not currently part of date formats in org-mode and thus not part of the output from C-c .. Like C-c C-c on a timestamp any extraneous material in the date specification is removed and the week day is corrected to fit a given date, so partial junk input like
13-6-3 Wed Xyz 13:00
is output as
<2013-06-03 Mon 13:00>
You can use org-read-date to convert timestamp strings into internal times
(org-read-date nil t "<2015-11-06>" nil)
This can be compared to either (org-read-date nil t "today" nil) which always returns the current date or directly to the output of (current-time).
Sure such evil stuff is possible with elisp. But be warned. I am not aware of all the dark consequences that this evil piece of black art has.
When you interactively run freeze-time you can input the date string at which you want to freeze the time.
From then on time is frozen until you run release-time which undoes this science fiction scenario.
Do not ...
I start typing different keywords in M-x and see completion to:
That is mostly what I look for:
display-time-world is an interactive autoloaded compiled Lisp function in
Enable updating display of times in various time zones.
`display-time-world-list' specifies the zones.
To turn off the world time ...
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.html
The following is a custom function that uses the org-mode and calendar-mode libraries. Upon my examination of calendar-count-days-region, I saw that the ...
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))
;; => "<2018-04-12 Thu 02:58:30>"
;; => (28800 "CST")
As you can see my timezone is +08:00 or CST or Asia/Shanghai, you can also specific a ...
The Org syntax for the DEADLINE event differs from what you use in your question. Instead of
* TODO fix this bug asap
:UPDATE: writing test cases almost there!
you should write:
* TODO fix this bug asap
DEADLINE: <2019-11-30 Sat>
:UPDATE: writing test cases almost there!
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 valid).
Use S-arrows, <, and > for navigation. See the manual for more information.
This way I get the error Invalid time specification.
OK. Maybe I need to encode times first:
Now I get the error Wrong type argument: fixnump, nil.
This is because parse-time-string is documented as returning nil for unknown entries, such as those for the date (emphasis mine):
parse-time-string is a compiled Lisp function in `parse-time.el'.
You can use the format-time-string function to format the time in different ways, for your example this should work:
* TODO meditate
SCHEDULED: `(format-time-string "<%Y-%m-%d %a 8:30am>" (current-time))`
This happens because org-insert-time-stamp inserts a time stamp (like the name says), but also returns the time stamp. Yasnippit inserts the return value but you're also left with the one inserted by the function call. A fix is to capture the return value, leaving only the inserted value: (let ((x (org-insert-time-stamp nil t t )))).
parse-time-string parses "standard" time strings, as does org-parse-time-string. The documentation claims the latter will be faster. Neither gives a way to specify the format of the string.
There is also an undocumented function parse-iso8601-time-string that parses ISO8601 into something. It isn't clear to me what the output is supposed to be.
Use the standard change hooks to record that information: https://www.gnu.org/software/emacs/manual/html_node/elisp/Change-Hooks.html#Change-Hooks
If you record it, make sure it's in a buffer-local variable, so each buffer can have its own value.
Here's a sample implementation:
(defvar buffer-last-change-time nil "The last change time")
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 a variable or compute it with a
function call, etc.
(let ((best-day-ever '(2017 8 21)))
(apply #'format "%04d-%02d-%02d" best-day-ever))
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 formulas. For an example you can do the total sum of the durations.
The following lisp function avoids truncation errors in the time calculations. You can copy ...
I have the following in my .emacs:
(lambda (arg) (interactive "P")
(let ((separator (pcase arg
(format-time-string (concat "%Y" separator "%m&...
The following will work:
# Local Variables:
# org-time-stamp-custom-formats: ("<%Y-%m>" . "<%Y-%m %H:%M>")
# eval: (org-toggle-time-stamp-overlays)
Using (org-toggle-time-stamp-overlays) (C-cC-xC-t) to ensure they are properly displayed.
You will need to confirm that these are safe local variables for them to apply ...
I made an Elisp only solution:
You can call it using M-x dow-time and in code using (dow-time 3)
(defvar dow-time-days '(("Monday" . 1)
("Tuesday" . 2)
("Wednesday" . 3)
("Thursday" . 4)
("Friday" . 5)
("Saturday" . 6)
I came up with something like this:
(defun my-format-time (time-string)
(let* ((time (parse-time-string time-string))
(day (nth 3 time))
(month (nth 4 time))
(year (nth 5 time)))
;; I would love to do an 'apply here, but the given list to be encoded contains nil which does n