guile-user
[Top][All Lists]
Advanced

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

Re: How do you format date-times in RFC 3339 style?


From: sirgazil
Subject: Re: How do you format date-times in RFC 3339 style?
Date: Tue, 12 Feb 2019 13:15:41 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

El 12/02/19 a las 11:50 a. m., Ricardo Wurmus escribió:

sirgazil <address@hidden> writes:

El 11/02/19 a las 4:39 p. m., Nala Ginrut escribió:
Hi there!
Guile web module has provided an unexpected API for that:

(define write-date (@@ (web http) write-date))


I think I prefer using public procedures, so I'll leave the error
there for now.

I suppose you could hack your way around this:

(use-modules (srfi srfi-19))
(let* ((now (current-date))
        (tz  (date->string now "~z")))
  (string-append (date->string now "~Y-~m-~dT~H:~M.~S")
                 (string-drop-right tz 2) ":" (string-take-right tz 2)))

What do you think?


Well, I was trying to avoid that hoping to find an obscure RFC 3339 module or something first... But thanks, Ricardo :)


--
Luis Felipe López Acevedo
http://sirgazil.bitbucket.io/





reply via email to

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