Re: timestamp

2022-02-12 Thread Eli Zaretskii
> From: Ricardo Wurmus > Date: Sat, 12 Feb 2022 14:49:20 +0100 > Cc: guile-user@gnu.org > > > The argument of lack of examples in the Guile/Guix documentation has > > been made several times now, or at least, I've seen it being made > > several times > > The Guix documentation contains examples,

Re: timestamp

2022-02-12 Thread adriano
Il giorno sab, 12/02/2022 alle 14.50 +0200, Eli Zaretskii ha scritto: > > Date: Sat, 12 Feb 2022 10:01:25 +0100 > > From: > > > >   (strftime "%Y-%m-%d %H:%m:%s" (localtime 1607841890)) > >   => "2020-12-13 07:12:1607845490" > > I guess you meant %H:%M:%S, not %H:%m:%s... > this could end up i

Re: timestamp

2022-02-12 Thread adriano
Il giorno sab, 12/02/2022 alle 14.49 +0100, Ricardo Wurmus ha scritto: > > adriano writes: > > > The argument of lack of examples in the Guile/Guix documentation > > has > > been made several times now, or at least, I've seen it being made > > several times > > The Guix documentation contains e

Re: timestamp

2022-02-12 Thread Ricardo Wurmus
adriano writes: > The argument of lack of examples in the Guile/Guix documentation has > been made several times now, or at least, I've seen it being made > several times The Guix documentation contains examples, but it’s already very long and intimidating, so we started the Cookbook for more

Re: timestamp

2022-02-12 Thread adriano
I brought up these arguments up today because the recent discussions about Guile/Guix documentation encouraged me Those make me feel that not all is lost :-)

Re: timestamp

2022-02-12 Thread adriano
Hi Ricardo, thank you for chiming in :-) Il giorno sab, 12/02/2022 alle 12.49 +0100, Ricardo Wurmus ha scritto: > > Hi adriano, > > I’ve got no good answers as to “why” things are the way they are, but > the manual explains the range of these values: You're right, the manual does explain the r

Re: timestamp

2022-02-12 Thread tomas
On Sat, Feb 12, 2022 at 02:50:34PM +0200, Eli Zaretskii wrote: > > Date: Sat, 12 Feb 2022 10:01:25 +0100 > > From: > > > > (strftime "%Y-%m-%d %H:%m:%s" (localtime 1607841890)) > > => "2020-12-13 07:12:1607845490" > > I guess you meant %H:%M:%S, not %H:%m:%s... Good catch, Eli. Bad tomas:

Re: timestamp

2022-02-12 Thread Eli Zaretskii
> Date: Sat, 12 Feb 2022 10:01:25 +0100 > From: > > (strftime "%Y-%m-%d %H:%m:%s" (localtime 1607841890)) > => "2020-12-13 07:12:1607845490" I guess you meant %H:%M:%S, not %H:%m:%s...

Re: timestamp

2022-02-12 Thread Eli Zaretskii
> From: Ricardo Wurmus > Date: Sat, 12 Feb 2022 12:49:10 +0100 > Cc: guile-user@gnu.org > > > Hi adriano, > > I’ve got no good answers as to “why” things are the way they are, but > the manual explains the range of these values: > > > It seesm to be > > > > (tm:mon %3) > > > > This returns > >

Re: timestamp

2022-02-12 Thread tomas
On Sat, Feb 12, 2022 at 12:49:10PM +0100, Ricardo Wurmus wrote: > > Hi adriano, > > I’ve got no good answers as to “why” things are the way they are, but > the manual explains the range of these values: > > > It seesm to be > > > > (tm:mon %3) > > > > This returns > > > > 11 > > > > I expected 1

Re: timestamp

2022-02-12 Thread Ricardo Wurmus
Hi adriano, I’ve got no good answers as to “why” things are the way they are, but the manual explains the range of these values: > It seesm to be > > (tm:mon %3) > > This returns > > 11 > > I expected 12 but ok, I recognize this kind of weirdness -- Scheme Procedure: tm:mon tm -- Scheme Proc

Re: timestamp

2022-02-12 Thread adriano
Il giorno sab, 12/02/2022 alle 10.01 +0100, to...@tuxteam.de ha scritto: > 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

Re: timestamp

2022-02-12 Thread adriano
Vivien, thank you ! Il giorno sab, 12/02/2022 alle 09.52 +0100, Vivien ha scritto: > > (use-modules (srfi srfi-19)) ;; Time and date stuff > (time-utc->date (make-time time-utc 0 1607841890))  > ;; Zero for nanoseconds comes before the seconds > > Vivien I also found this scheme@(guile-user)

Re: timestamp

2022-02-12 Thread tomas
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

Re: timestamp

2022-02-12 Thread Vivien
Hello, Le samedi 12 février 2022 à 09:37 +0100, adriano a écrit : > scheme@(guile-user)> (stat:ctime (stat "cat.jpg")) > $5 = 1607841890 > > How do I get a timedate from that number ($5) ? (use-modules (srfi srfi-19)) ;; Time and date stuff (time-utc->date (make-time time-utc 0 1607841890))  ;;