Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [parse-time]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
13 votes
2 answers
2k 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 ...
Matthew Piziak's user avatar
6 votes
1 answer
681 views

How to make org-mode DWIM when it reads times in timestamps?

Q: how can I make org-mode read the time in timestamps intelligently? org-mode uses org-read-date (which in turn relies on parse-time-string) to create/modify timestamps, scheduled items, and ...
Dan's user avatar
  • 33.1k
6 votes
1 answer
407 views

How to make org-mode understand alternate day/month abbreviations?

Q: How can I make org-mode understand alternate day/month abbreviations? org-mode uses the function org-read-date when entering timestamps, scheduling dates, and creating deadlines. One may enter ...
Dan's user avatar
  • 33.1k
4 votes
1 answer
356 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.
user117529's user avatar
3 votes
1 answer
388 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 ...
algal's user avatar
  • 345
3 votes
1 answer
1k 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 ...
Håkon Hægland's user avatar
3 votes
2 answers
724 views

How to make org-mode timestamps understand a new abbreviation for "tomorrow"?

Q: How can I make org-read-date understand an abbreviation that calls a function that returns tomorrow's day of the week? The super-short version: I'm trying to get the timestamp functionality of +1d ...
Dan's user avatar
  • 33.1k
2 votes
1 answer
627 views

How to compare date strings?

I have a LaTeX package declared with a date: \usepackage{foo}[=2021-04-01] and I need to check if this date is before or after "2021-03-01". Is there a way to compare dates, like (if (< ...
Onner Irotsab's user avatar
2 votes
1 answer
659 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 <...
Alexander Shcheblikin's user avatar
2 votes
0 answers
712 views

How to parse calendar date or timestamp at cursor from elisp?

Is there a function to parse the text around the cursor and return the date if found? E.g., if I'm in a buffer with the cursor in the middle of this text: 2015-12-01 First day of new exercise ...
nealmcb's user avatar
  • 194
1 vote
3 answers
134 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 ...
Niclas Börlin's user avatar
1 vote
1 answer
243 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 "...
Hatshepsut's user avatar
1 vote
1 answer
637 views

What's the inverse of (format-time-string "%s")?

Parsing formatted time string (inverse of format-time-string) asks for a complete inverse of format-time-string with the ability to specify the source format, but I really just need to get from a UNIX ...
Sean Allred's user avatar
  • 6,941
1 vote
1 answer
69 views

Setting minimum time between consecutive reparses by semantic

According to the Semantic docs, semantic-edit.el is the file which handles all incremental parsing. I see frequent incremental parse errors(not information messages, since I have semantic-edits-...
Pradhan's user avatar
  • 2,370
1 vote
1 answer
621 views

Emacs lisp function to count the difference between two times

I would like to write an Emacs lisp function, that I can bind to a key shortcut. It will read in the two previous time entries in the format HHMM from the buffer and spit out the difference between ...
Charley Ramm's user avatar
1 vote
0 answers
37 views

time-zone-valid-p: Is there such a function?

I am trying to debug an invalid timezone '(nil nil nil) that is causing encode-time to choke on the optional ZONE argument. Q:  Is there a time-zone-valid-p function anywhere that I can use to test ...
lawlist's user avatar
  • 19.2k
0 votes
1 answer
211 views

parse-time-string: doesn't accept ISO 8601 string contrary to what the documentation claim

The documentation suggests that parse-time-string can be fed ISO 8601 string, such as "1998-09-12T12:21:54-0200". However, (parse-time-string "1998-09-12T12:21:54-0200") returns (...
Firmin Martin's user avatar
0 votes
2 answers
833 views

elisp timedelta output format

When try to print timedelta as below: #+BEGIN_SRC elisp :results output (print (time-subtract (parse-time-string "2018-10-20 08:50:36.343") (parse-time-string "2018-10-20 08:47:43.029"))) #+...
lucky1928's user avatar
  • 1,668
0 votes
0 answers
102 views

Org-mode spreadsheet time diff elisp formula or GNU Calc

I wish to substract from a start time an end time in my org-mode spreadsheet. My times strings look like this (only the inline code): starttime: 9:42 or 09:42 endtime: 18:20 So it's 24h format. I ...
Zelphir Kaltstahl's user avatar
0 votes
0 answers
101 views

How to make org understand a custom timestamp format

I have the following line below a "TODO": SCHEDULED: <Oct 27, 2018 08:30PM> Right now, the org-mode throws the following error: Error was: (Not a standard Org time string: Oct 27, 2018 08:...
Sainath Adapa's user avatar