Re: [PATCH] lib/timeutils: Add %s (seconds since the Epoch) to parse_timestamp()

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

 



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



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux