emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ascii-timestamps like 31.12.2021 to iso(org) format <2020-12-31> and


From: Uwe Brauer
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>>> "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: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]