util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] lib/timeutils: Add %s (seconds since the Epoch) to parse_timestamp()
Date: Tue, 6 Sep 2022 19:31:07 +0300	[thread overview]
Message-ID: <849c4ca2-a1b7-7429-1b3c-fc135d9f4d72@linux.intel.com> (raw)
In-Reply-To: <20220906084716.4bgsdahoyjfaaksc@ws.net.home>

Hi Karel,

On 06/09/2022 11:47, Karel Zak wrote:
> On Tue, Sep 06, 2022 at 10:04:36AM +0300, Peter Ujfalusi wrote:
>>  lib/timeutils.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
> 
> Applied, thanks.

After some tinkering with a script where I needed this, would it make
sense to change the way how one should be specifying seconds since the
Epoch time to
'@'<number>

This would match how for example systemd.time requires it [1]

Basically I (or anyone) can use dmesg instead of journalctl in a script
with the same --since=@<timestamp> parameter.

'date +%s' prints out just a number.

If not, then I have made a rookie mistake with the patch, which should
be fixed (discarding the seconds we got out from the timestamp).
/me hides

[1] https://www.man7.org/linux/man-pages/man7/systemd.time.7.html

-- 
Péter

  reply	other threads:[~2022-09-06 16:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06  7:04 [PATCH] lib/timeutils: Add %s (seconds since the Epoch) to parse_timestamp() Peter Ujfalusi
2022-09-06  8:47 ` Karel Zak
2022-09-06 16:31   ` Péter Ujfalusi [this message]
2022-09-07  7:20     ` Karel Zak
2022-09-07 12:57       ` Dmitry V. Levin
2022-09-08  9:29       ` Péter Ujfalusi

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=849c4ca2-a1b7-7429-1b3c-fc135d9f4d72@linux.intel.com \
    --to=peter.ujfalusi@linux.intel.com \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.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 NNTP newsgroup(s).