all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pierre Rouleau <prouleau001@gmail.com>
To: Dr Rainer Woitok <rainer.woitok@gmail.com>
Cc: Help-Gnu-Emacs@gnu.org
Subject: Re: Get current date and time as a string?
Date: Wed, 22 May 2024 14:18:19 -0400	[thread overview]
Message-ID: <CALTqLiYQ-n0J5KkJV=AAmT-VbA9y+fdNNnE32PyJOHtEM+tj-A@mail.gmail.com> (raw)
In-Reply-To: <26189.54659.295857.993689@woitok.gmail.com>

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"
ELISP>

Hope this helps

On Wed, May 22, 2024 at 7:23 AM Dr Rainer Woitok <rainer.woitok@gmail.com>
wrote:

> Greetings,
>
> after having unsuccessfully used "C-h a" to find a command returning the
> current date and time (preferably as "YYYY-MM-DDThh:mm:ss") I'm now ask-
> ing the combined wisdom of this list: is there such a thing?
>
> Sincerely,
>   Rainer
>
>

-- 
/Pierre


  parent reply	other threads:[~2024-05-22 18:18 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 [this message]
2024-05-23  0:34   ` Emanuel Berg

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALTqLiYQ-n0J5KkJV=AAmT-VbA9y+fdNNnE32PyJOHtEM+tj-A@mail.gmail.com' \
    --to=prouleau001@gmail.com \
    --cc=Help-Gnu-Emacs@gnu.org \
    --cc=rainer.woitok@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.