From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Guy Baumann" Newsgroups: gmane.lisp.guile.user Subject: Help formatting a UTC TImestamp Date: Tue, 14 Feb 2017 07:45:12 +0000 (GMT) Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1487084328 28736 195.159.176.226 (14 Feb 2017 14:58:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2017 14:58:48 +0000 (UTC) To: "guile-user" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Feb 14 15:58:45 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdeYv-00072K-0m for guile-user@m.gmane.org; Tue, 14 Feb 2017 15:58:37 +0100 Original-Received: from localhost ([::1]:35304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdeZ0-0006Lq-QR for guile-user@m.gmane.org; Tue, 14 Feb 2017 09:58:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdXnd-0000BE-9z for guile-user@gnu.org; Tue, 14 Feb 2017 02:45:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdXnY-0006pb-Do for guile-user@gnu.org; Tue, 14 Feb 2017 02:45:21 -0500 Original-Received: from aibo.runbox.com ([91.220.196.211]:38610) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdXnY-0006oM-5h for guile-user@gnu.org; Tue, 14 Feb 2017 02:45:16 -0500 Original-Received: from [10.9.9.129] (helo=rmmprod07.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1cdXnU-0003iF-UV for guile-user@gnu.org; Tue, 14 Feb 2017 08:45:13 +0100 Original-Received: from mail by rmmprod07.runbox with local (Exim 4.86_2) (envelope-from ) id 1cdXnU-0003Ye-Ss for guile-user@gnu.org; Tue, 14 Feb 2017 08:45:12 +0100 Content-Disposition: inline Original-Received: from [Authenticated user (782968)] by runbox.com with http (RMM6); for ; Tue, 14 Feb 2017 07:45:12 GMT X-Mailer: RMM6 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 91.220.196.211 X-Mailman-Approved-At: Tue, 14 Feb 2017 09:58:21 -0500 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13196 Archived-At: I am trying to format a timestamp from an api. It is the format "2011-03-2= 4T20:30:47Z" what I want to produce is something like this (strftime "%d %b %g " (localtime (current-time)) ) However I am unable to work out how to do this, have tried using string->da= te with results below Enter `,help' for help. scheme@(guile-user)> (define date "2011-03-24T20:30:47Z") scheme@(guile-user)> (use-modules (srfi srfi-19)) scheme@(guile-user)> (string->date "~Y-m-dT~H:~M:SZ" date) srfi/srfi-19.scm:1415:18: In procedure priv:string->date: srfi/srfi-19.scm:1415:18: In procedure string->date: TIME-ERROR type bad-da= te-format-string: "2011-03-24T20:30:47Z" Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> (string->date date "~Y-m-dT~H:~M:SZ") srfi/srfi-19.scm:1415:18: In procedure priv:string->date: srfi/srfi-19.scm:1415:18: In procedure string->date: TIME-ERROR type bad-da= te-format-string: "~Y-m-dT~H:~M:SZ" Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [2]> (string->date date "~Y-m-dT~H:~M:SZ") srfi/srfi-19.scm:1415:18: In procedure priv:string->date: srfi/srfi-19.scm:1415:18: In procedure string->date: TIME-ERROR type bad-da= te-format-string: "~Y-m-dT~H:~M:SZ" Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [3]> (string->date "2000" "~Y") srfi/srfi-19.scm:571:22: In procedure encode-julian-day-number: srfi/srfi-19.scm:571:22: In procedure -: Wrong type: #f thanks for any help //guy