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 program
2016-01-08 Hit a milestone: ran a 7-minute-mile
and I want to use emacs to parse the dates and tell me the elapsed time between them, is there a function to help me do that? Ideally it would handle full ISO timestamps also, e.g.
2016-01-08T08:13:55-0700
and of course other date formats. Yeah - I know - it gets tricky, might need some hinting on formats, etc....
It looks like date-to-time
can parse ISO strings, and parse-time-string
can parse some formats, but not ISO. But are there any functions to pick the right text from around the cursor?
See e.g. Emacs Lisp: Parsing Date Time