From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: adriano Newsgroups: gmane.lisp.guile.user Subject: Re: timestamp Date: Sat, 12 Feb 2022 10:43:52 +0100 Message-ID: <098bbd5f1c81414521015479b7e2b17d8809f1bd.camel@riseup.net> References: <5cae853e6252bb3e38b1a20ff9ea960c1756c68c.camel@riseup.net> <9d45b2d6c007a8e9ca1e0656deed190f1181e035.camel@planete-kraus.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6650"; mail-complaints-to="usenet@ciao.gmane.io" To: Vivien , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Feb 12 10:44:46 2022 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIoxS-0001ZG-1j for guile-user@m.gmane-mx.org; Sat, 12 Feb 2022 10:44:46 +0100 Original-Received: from localhost ([::1]:49698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIoxQ-0002bk-It for guile-user@m.gmane-mx.org; Sat, 12 Feb 2022 04:44:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIowi-0002af-65 for guile-user@gnu.org; Sat, 12 Feb 2022 04:44:02 -0500 Original-Received: from mx1.riseup.net ([198.252.153.129]:60656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIowf-0003Hs-P2 for guile-user@gnu.org; Sat, 12 Feb 2022 04:43:59 -0500 Original-Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4JwltN1grYzF4dZ; Sat, 12 Feb 2022 01:43:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1644659036; bh=X6E2Fbs4p50dlPWFEbdwGoAfRBdHpxq+wSz80YIaSqU=; h=Subject:From:To:Date:In-Reply-To:References:From; b=fO4evi0O0+y93ZL9JIQqek2zxZ1FcQVPCZr3Q5zdGRaMSShTdCnGe/u5blfnSxZiw 4lHnWZ612Rl7pHl9kyTYLHeLVUC8sB0Tj22aIgXDoVqqRSTC1iSswyVA8swhc6FvnU Cx3lpjDHt233M4d71rw6HmSNtwa4K8/Qn2GI/E/0= X-Riseup-User-ID: 7E7EE421144D4DF47F254D3E8762D783F18F301476EF7EFE0D0183EE9C391DB9 Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4JwltM0t3Jz5vNJ; Sat, 12 Feb 2022 01:43:54 -0800 (PST) In-Reply-To: <9d45b2d6c007a8e9ca1e0656deed190f1181e035.camel@planete-kraus.eu> Received-SPF: pass client-ip=198.252.153.129; envelope-from=randomlooser@riseup.net; helo=mx1.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18080 Archived-At: 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)> (strftime "%c" (localtime (stat:ctime (stat "cat.jpg")))) $2 = "dom 13 dic 2020, 07:44:50" On one side, this gives me something I can grasp, localized and all. Good On another side, it opens new misteries ,d localtime - Scheme Procedure: localtime time [zone] Return an object representing the broken down components of TIME, an integer like the one returned by `current-time'. The time zone for the calculation is optionally specified by ZONE (a string), otherwise the `TZ' environment variable or the system default is used. So, "the broken down components of TIME" Let's take a look scheme@(guile-user)> (localtime (stat:ctime (stat "cat.jpg"))) $3 = #(50 44 7 13 11 120 0 347 0 -3600 "CET") What are those numbers ? broken down according to which schema ? Say I want to extract the month from $3, how do I do that ? It seesm to be (tm:mon %3) This returns 11 I expected 12 but ok, I recognize this kind of weirdness I'm unhappy with (tm:year $3) This returns 120 it's 2020 Why would 120 represent 2020 ? I guess there's some implied schema being used, here Probably defined in glibc ? It seems this is something obvious to people well versed in the conventions of "The GNU System" so of course it's not explicit in this paragraph of the manual (as far as I can tell, maybe I'm not reading hard enough) Ok, so, this seems relevant https://www.gnu.org/software/libc/manual/html_node/Broken_002ddown-Time.html The "tm" 'struct' is being referred to in the Guile manual and it's implicit that it's defined elsewhere This habit of giving the GNU system and the glibc as an _implicit_ requirement is wrong, in my opinion, it's pointlessly punishing I understand where it comes from But I think it's be way more useful if the Guile docs introduced people to the whole thing (whatever that is), not to a fragment But that's for a different discussion Thanks again, Vivien