guile-user
[Top][All Lists]
Advanced

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

Re: timestamp


From: tomas
Subject: Re: timestamp
Date: Sat, 12 Feb 2022 10:01:25 +0100

On Sat, Feb 12, 2022 at 09:37:17AM +0100, adriano wrote:
> This
> 
> scheme@(guile-user)> (stat:ctime (stat "cat.jpg"))
> $5 = 1607841890
> 
> How do I get a timedate from that number ($5) ?

The traditional POSIX-ish functions are built in:

  (localtime 1607841890)
  => #(50 44 7 13 11 120 0 347 0 -3600 "CET")

  (strftime "%Y-%m-%d %H:%m:%s" (localtime 1607841890))
  => "2020-12-13 07:12:1607845490"

If you want to "go further", there is "SRFI-19 Time/Date conversions".

HTH
-- 
tomás

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]