unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Heime <heimeborgia@protonmail.com>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Storing hours, minutes, seconds, and nanoseconds from format-time-string
Date: Tue, 06 Dec 2022 11:19:43 +0100	[thread overview]
Message-ID: <87pmcw6dhc.fsf@gmx.net> (raw)
In-Reply-To: <AS6FMVqpNJ2yj9y4QHcf3m5seWmFwltHxMcm66sf1LlF3Cq10WdliwPtIX5tJSC8ege9RhufG9f3wN36cAPJRj62-JPMT1rxTg1fzMYoA_w=@protonmail.com> (Heime's message of "Tue, 06 Dec 2022 09:23:24 +0000")

On Tue, 06 Dec 2022 09:23:24 +0000 Heime <heimeborgia@protonmail.com> wrote:

> I am getting the time using the format "%FT%T.%N%z".
>
> (format-time-string "%FT%T.%N%z" nil tzone)
>
> From the result I need to get the hours, minutes, seconds,
> and nanoseconds to store them into four numeric variables.
>
> How can I do this from the output of "format-time-string".

You can pass the output to string-split, splitting on non-digits,
i.e. using "[^[:digit:]]" as the value of the SEPARATORS argument.

Steve Berman



  reply	other threads:[~2022-12-06 10:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06  9:23 Storing hours, minutes, seconds, and nanoseconds from format-time-string Heime
2022-12-06 10:19 ` Stephen Berman [this message]
2022-12-06 12:07   ` Heime
2022-12-06 12:14     ` Stephen Berman
2022-12-06 14:34     ` Emanuel Berg
2022-12-06 15:04       ` Thibaut Verron
2022-12-06 15:22 ` Thibaut Verron

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=87pmcw6dhc.fsf@gmx.net \
    --to=stephen.berman@gmx.net \
    --cc=heimeborgia@protonmail.com \
    --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).