From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: Re: ascii-timestamps like 31.12.2021 to iso(org) format <2020-12-31> and back
Date: Fri, 31 Dec 2021 17:05:46 +0100 [thread overview]
Message-ID: <87h7aoiwth.fsf@mat.ucm.es> (raw)
In-Reply-To: 87bl0wj2pt.fsf@ucl.ac.uk
[-- Attachment #1: Type: text/plain, Size: 740 bytes --]
>>> "ESF" == Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> On Friday, 31 Dec 2021 at 14:21, Uwe Brauer wrote:
>> ⚠️ Caution: External sender
>>
>>
>> Hi
>>
>> Does anybody know about a function that would convert between
>> date format like 31.12.2021 to <2020-12-31> and back?
> This is Emacs, of course, so you could use query-replace-regexp (M-%)
> with, for instance
> \([0-9][0-9]\)\.\([0-9][0-9]\)\.\([0-9]\{4\}\)
> as the pattern to search for and
> <\3-\2-\1>
> as the replacement. The converse is left as an exercise for the
> reader. ;-)
Thanks the \{4\} surprise me. I tried
(query-replace-regexp "\\(\\<[0-9]*\\)\\([\\.]\\)\\([0-9]*\\>\\)" "\\3\\2\\1")
And that did not work.
Uwe
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
next prev parent reply other threads:[~2021-12-31 16:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-31 13:21 ascii-timestamps like 31.12.2021 to iso(org) format <2020-12-31> and back Uwe Brauer
2021-12-31 13:58 ` Eric S Fraga
2021-12-31 16:05 ` Uwe Brauer [this message]
2021-12-31 16:40 ` Eric S Fraga
2022-01-04 10:00 ` Max Nikulin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h7aoiwth.fsf@mat.ucm.es \
--to=oub@mat.ucm.es \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).