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 ...
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 ...
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 ...
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
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-...
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 ...
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))
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 ...
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>...
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.
Dates can be used in formulas.
The following example should be similar to what you are asking for:
| | | Date | Other |
| $ | | start=<2015-12-07> | |
| # | 1 | <2015-12-14 Mon> | |
| # | 2 | <2015-12-21 Mon> | |
| # | 3 | <2015-12-28 Mon> | ...
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 )))).
Base on your own answer, here is another way to do it.
(defun iso-week-to-time (year week day)
(pcase-let ((`(,m ,d ,y)
(calendar-iso-to-absolute (list week day year)))))
(encode-time 0 0 0 d m y)))
(format-time-string "%F" (iso-week-to-time 2018 32 2))
;; => "...
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) RET.
Another possibility is to input the number of days and then convert them to HMS form using the function calc-to-hms (bound to ch). So for your example ...
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>
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
As stated in a comment of mine underneath a similar / duplicate question by this original poster -- how to detect selection in date mode? -- the function org-read-date is the best choice:
The following example function demonstrates proposed usage of org-read-date based on the outline of the original poster:
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))`
See org-element-timestamp-parser (parses the timestamp at point, including the repeater part) and org-element-timestamp-interpreter (transforms a timestamp object back into Org syntax).
For example, calling (org-element-timestamp-parser) with the point at the "<" of "<2016-01-25 Mon 14:51 +1w>" produces
(timestamp (:type active
The function you are looking for is file-attributes. The help text is fairly detailed but you will be wanting:
4. Last access time, as a list of integers (HIGH LOW USEC PSEC) in the
same style as (current-time).
(See a note below about access time on FAT-based filesystems.)
5. Last modification time, likewise. This is the time of the last
change to the ...
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")
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 however once they are ...
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 independent of each other, e.g. whether you watered on Monday doesn't have any impact on whether you'd still have to water it on Wednesday, so why not just leave ...
parse-iso8601-time-string already returns a time value that format-time-string accepts: