From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Get current date and time as a string?
Date: Thu, 23 May 2024 02:34:25 +0200 [thread overview]
Message-ID: <87ikz574dq.fsf@dataswamp.org> (raw)
In-Reply-To: CALTqLiYQ-n0J5KkJV=AAmT-VbA9y+fdNNnE32PyJOHtEM+tj-A@mail.gmail.com
Pierre Rouleau wrote:
> The function you are looking for is `format-time-string'.
> Get help on it with ``C-h f format-time-string``
>
> Use ielm (the Elisp shell) to experiment while the help is
> shown inside another buffer.
>
> *** Welcome to IELM *** Type (describe-mode) or press C-h m for help.
> ELISP> (format-time-string "%Y-%m-%d")
> "2024-05-22"
> ELISP> (format-time-string "%Y-%m-%dT%H:%M:%S")
> "2024-05-22T14:15:11"
Close but no cigar :)
(format-time-string "%FT%T") ; 2024-05-23T02:32:40
--
underground experts united
https://dataswamp.org/~incal
prev parent reply other threads:[~2024-05-23 0:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 11:22 Get current date and time as a string? Dr Rainer Woitok
2024-05-22 11:29 ` Emanuel Berg
2024-05-22 11:30 ` Joost Kremers
2024-05-22 11:52 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-05-22 11:59 ` Joost Kremers
2024-05-22 16:27 ` tpeplt
2024-05-22 18:18 ` Pierre Rouleau
2024-05-23 0:34 ` Emanuel Berg [this message]
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ikz574dq.fsf@dataswamp.org \
--to=incal@dataswamp.org \
--cc=help-gnu-emacs@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.
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).