Questions tagged [time-date]

is for time of day, handling date and time formats, interfacing with the operating system for date and time values, converting time zones, and calculating date and time arithmetic.

Filter by
Sorted by
Tagged with
21
votes
2answers
914 views

Is there a mode to automatically update copyright years in files?

Usually around this time of year people start to realize that their copyright year is out of date in their files. This is particularly annoying if you like to put the copyright in every source file. I ...
9
votes
2answers
761 views

Parsing formatted time string (inverse of format-time-string)

The format-time-string function takes a time argument like '(21761 64499 350937 0) and a format string like "%y-%m-%d %a %H:%M" and returns something like "15-03-12 Thu 16:49". What is the inverse ...
7
votes
3answers
3k views

in org-mode, how to insert timestamp with today's date?

In a Lisp function, how do I instruct org to automatically insert a timestamp with today's date? I found the function org-insert-time-stamp, but I don't know how to provide an argument for it that ...
7
votes
1answer
195 views

Increment days / months / dates, etc. within buffer

In a text document, while editing, I often need to increment/ decrement calendar data. So, Friday will need to become Monday, December will need to become March, etc. Or 28 Apr after adding 5 will ...
6
votes
2answers
696 views

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

I have an org-mode document in which I wish to keep track of the number of days that have passed since a certain date. Is there a built in function for this, or will I be forced to write a custom ...
6
votes
2answers
625 views

Elisp function to see a date for next Wednesday

Admitting up front that I am not capable of much Lisp, I have found ways to produce the current date or a number of seconds from a date, but I am looking for a simple equivalent to shell command like ...
6
votes
2answers
1k views

How can I change Org-mode time format for one buffer?

In general all timestamps in Org-mode appears as [YYYY-MM-DD Day]. I have one file (buffer) where I would like the format to be different. Either just [YYYY-MM-DD] or [YYYY-MM]. How do I tell Org-mode ...
6
votes
2answers
852 views

Multiple Scheduled Timestamps for One Task

Suppose I want to be reminded to water my plants on Monday, Wednesday, and Friday, AND on any of the following days, if for some reason I miss the scheduled days. I originally tried the following: **...
6
votes
1answer
888 views

Specify timezone in Org date format

When I write something like this: <2015-07-05 Sun 20:00 GMT+0>, and then try to edit it by pressing C-c ., Org removes the GMT+0 part. So, I think it's in a wrong format. Note: I don't want to ...
4
votes
1answer
311 views

Change date from active to inactive

I want to change an active date <2017-12-10 17:04> to inactive date [2017-12-10 17:04] and vice versa. How do I do that?
4
votes
2answers
367 views

Convert Unix time to Org-mode timestamp

How can I convert a Unix time to an Org-mode local timestamp? For example (convert 1523473110) should return <2018-04-11 Wed 15:58:30>. I found org-timestamp--to-internal-time, but that uses "...
4
votes
2answers
436 views

Get time in AM/PM format

(format-time-string "%p") is empty in my Emacs. How I can format date in AM/PM format? That answer second part of Show time in different time zones UPDATE (length (format-time-string "%p")) ; is 0 ...
4
votes
1answer
328 views

Display months/days or timestamps in another language than English

Setup: GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL compiled from EmacsW64. Windows 7 x64 Dutch version. Situation: When I'm evaluating the following snippet: (...
3
votes
2answers
590 views

Converting plain text to dates

Is it possible to convert plain text dates to Org dates automatically? I have entries in the format: 16 February 2015 which I would like to convert to Org dates: <2015-02-16 Mon>
3
votes
2answers
81 views

Convert between ISO week and a normal date

How can you convert between ISO year-week-day and an elisp date that can be sent to, e.g., format-time-string? I do not want to go via a string representation. I found the following old question on ...
3
votes
1answer
2k views

How to display time in seconds in the mode line?

By default display-time-mode shows the time only in minutes. How I can display time in seconds? Something like 18:34:45".
3
votes
1answer
54 views

Column of programmatically updated dates in org-mode

I'm trying to make a table in org-mode, the first column of which should be the Monday of each week starting with a date I specify. So, for example, if I specify Dec 14th, I would get a column with ...
3
votes
2answers
653 views

Show time in different time zones

I take a lot of different MOOC and each class declare own deadline relative to some time zone. Are there any Emacs mode that show date/time in buffer for several selected time zones in same time? I ...
3
votes
0answers
100 views

How to get the (localized) day of the week lowercased in time-stamp-format?

The %:a allows to get the full weekday in the Time-stamp. My system-time-locale is fr_FR.UTF-8. I am using the Time-stamp in a Markdown file, inside a pandoc title block, which I export to html, so I ...
2
votes
1answer
138 views

Is it possible to change and freeze the current date-time in Emacs?

I'm a heavy Emacs Org-mode user and VERY dependent on the date functionality. I frequently enter events, receipts, etc. using capture templates after they've already occurred. My current solution is ...
2
votes
1answer
635 views

How to insert inactive [timestamp] via function?

C-u C-c ! generates a time stamp like [2015-05-04 Mon 17:13] I would like to assign a shortcut (e.g F1) to this action. So far I have: (defun my/timenow (&optional arg) (interactive) (let (...
2
votes
1answer
67 views

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

Is there a way to retrieve the date under the cursor in emacs calendar as the format day.month.year like 05.07.2018 as a clipboard content?
2
votes
1answer
269 views

org-mode timestamp repeater interval manipulation

What are (if any) the lisp functions to read and write the repeater interval part of the org-mode timestamps? (The ones at the end of the timestamp string, which are optional, e.g. +1w or +6d in <...
2
votes
1answer
790 views

in yasnippet, how to insert variable date with fixed time of day?

I want a yasnippet to insert an org-mode date and time. The date should be today's date, but the time should be fixed. So far my snippet correctly inserts today's date, but not the time: # -*- ...
2
votes
1answer
518 views

Compare file modification time stamps

Background I am using Emacsclient to open files in a Emacs server. The server configuration depends on the content of a JSON configuration file. A Perl script can read the config file and write a ...
2
votes
1answer
255 views

Is there a view that can show time entered per day?

Basically I am after a method to find missing times. Currently I use this code to view times per task. #+BEGIN: clocktable :link t :maxlevel 10 :block week :scope file But I can not view if i am ...
2
votes
1answer
736 views

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

I would like to show sum of efforts for all tasks for a day in Org-Agenda day title. E.g. for a week agenda there would be 7 sums for each of the day, in their respective titles. I think this could ...
2
votes
1answer
91 views

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

Is there a built-in way to convert/toggle between GNU Emacs Calc's HMS forms and seconds? I'd also like to easily be able to add numbers as seconds and/or minutes to an existing HMS form.
2
votes
1answer
65 views

Query org agenda build time?

Q: how can I get the last time I built the org agenda buffer? I've set an idle timer to rebuild my org agenda buffer every x minutes. It works fine, but it's inefficient to rebuild if the agenda ...
2
votes
1answer
97 views

meta-data related to the current buffer

How can I retrieve the date/time of the creation of the current file (file-date-time-of-creation) on my system? The same question can arise for the size. A related question was asked here. This is a ...
2
votes
1answer
182 views

Invalid date: 01-Jan-2055

I recently downloaded Emacs 24.4 and sometimes I see an "invalid date" error in my buffer. When I am in eww, often I try to click (RET) a link and I get: error in process sentinel: Invalid date: 01-...
2
votes
0answers
43 views

Org-mode adding statistic cookie to date-tree lines in capture

In this video(timestamped to relevant section), I see this guy's org file in a date-tree with the [/] statistic cookie next to each YYYY-MM-DD headline. https://youtu.be/-2RXhPV_zgc?t=12m51s I'd ...
1
vote
3answers
76 views

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

Let's say I have a list of integers, representing year, month, day for a date: (2017 8 21) and I want to format the list in one function call, as in (format "%04d-%02d-%02d" 2017 8 21) Is there an ...
1
vote
1answer
538 views

Convert org-time-stamp

I need a function that can determine whether an org-time-stamp in a table equals the current date. Example: #+NAME: test | date | breakfast | |------------------+-----------| | <2015-...
1
vote
2answers
251 views

The time of the last change of the current buffer

Can Emacs determine the time of the last change (or the last edit) done to the current buffer? The buffer may has been saved or not.
1
vote
2answers
543 views

Yasnippet invoked org-time-stamp function inserts double timestamp

I created a yasnippet template to quickly timestamp a note I'd like to make in org-mode. The body of the yasnippet file reads $0 :PROPERTIES: :CREATED: `(org-insert-time-stamp nil t t)` :END: ...
1
vote
1answer
81 views

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

How do I use calc to add a time interval to a moment in time (i.e., a date, or a time)? For instance, say I want to know what the time and day will be 8,000 minutes into the future? I know that t N ...
1
vote
1answer
94 views

Convert a timestamp to local time

I have a timestamp string "2011-01-23T16:18:46-08:00" and I want to convert it to my local time zone. (format-time-string "%Y-%m-%dT%H:%M:%S%z" (decode-time (parse-iso8601-time-string "...
1
vote
2answers
148 views

How do I pick a date in my new major mode?

I want to insert a date in the current buffer. I know the function calendar-cursor-to-date that when invoked gives back the date at which the cursor is. But how do I get that info back into my ...
1
vote
1answer
210 views

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

I feel like elisp (or org-mode) must have something like (days-until '2018-01-01) which would calculate the days between today and 2018-01-01. How would I go about implementing that?
1
vote
1answer
973 views

Current time timestamp in org-capture-templates

In org-mode org-capture templates, what is the way to insert current time timestamp? I've tried %U like so: (setq org-capture-templates (quote ( ("k" "Capture an item and schedule it for ...
1
vote
1answer
465 views

How to display date in Julian in the mode line?

The following setting display the date in Gregorian calendar in the mode line. (setq display-time-day-and-date t) (display-time) My question is how to change the above settings for date to be shown ...
1
vote
1answer
53 views

What is the reason for this erratic behavior in `time-subtract`?

I am attempting to calculate some time differences in org time strings using time-subtract. (time-subtract (org-parse-time-string "2018-04-16 Mon 14:00") (org-parse-time-string "2018-...
1
vote
2answers
66 views

unable to restart or update a timer

I have simple timer which makes sure a function is executed for every 10 seconds. (setq interval 10) (defun run-every-ten-seconds () (do-something)) (defun start-timer () (setq timer (run-...
1
vote
1answer
31 views

Let org-timestamp-up/down work on non-timestamp

So in org-mode, shift-up and shift-down works on timestamps. Is there a way to let it work on arbitrary dates in the text that is not a timestamp? For example if I write The date is 2019-01-01. ...
1
vote
1answer
77 views

Determining the string formats for datetime-timezone

When loading a .log file I get the message Warning (emacs): Failed to determine system timezone; consider customizing ‘datetime-timezone’ variable Going to the customization menu, the options are ...
1
vote
0answers
56 views

Strategy for using Emacs as an event log?

I'd like to be able to use Emacs to track various events in my day-to-day life, such as paying a bill, going to an appointment, replacing oil, etc. The goal would be to be able to view this event in ...
1
vote
1answer
49 views

How to make implicit link target from timestamp in org-mode?

In org-mode I usually create several notes with timestamps under a headline, for example: * idea [2018-09-26 Wed 09:39] \\ General description of idea. ** idea development [2018-09-26 Wed 09:...
1
vote
0answers
19 views

Logbook clock entries as active/inactive time stamps in icalendar export

Is there a way to automatically have active/inactive timestamps updated in the body of the org node? My final goal is to have the clock entries included as events in icalendar export. Alternatively ...
1
vote
0answers
37 views

Twilight times in addition to sunrise/sunset?

The sunrise-sunset function from solar.el computes sunrise and sunset. I would also like to have a function that computes the end/beginning of civil twilight (center of sun 6 deg below horizon) ...