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 12:27:16 +0000 Message-ID: <20170214122716.GA2454@debian> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1487075309 14500 195.159.176.226 (14 Feb 2017 12:28:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2017 12:28:29 +0000 (UTC) User-Agent: Mutt/1.5.23 (2014-03-12) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Feb 14 13:28:25 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 1cdcDZ-0003Xs-Bt for guile-user@m.gmane.org; Tue, 14 Feb 2017 13:28:25 +0100 Original-Received: from localhost ([::1]:34258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdcDe-0001iL-Rs for guile-user@m.gmane.org; Tue, 14 Feb 2017 07:28:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdcDK-0001iD-AC for guile-user@gnu.org; Tue, 14 Feb 2017 07:28:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdcDF-00038W-Ft for guile-user@gnu.org; Tue, 14 Feb 2017 07:28:10 -0500 Original-Received: from aibo.runbox.com ([91.220.196.211]:34368) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdcDF-000366-8A for guile-user@gnu.org; Tue, 14 Feb 2017 07:28:05 -0500 Original-Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1cdcDB-0004V4-Tk for guile-user@gnu.org; Tue, 14 Feb 2017 13:28:02 +0100 Original-Received: from [213.152.161.133] (helo=debian) by mailfront10.runbox.com with esmtpsa (uid:782968 ) (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1cdcCv-0001wc-69 for guile-user@gnu.org; Tue, 14 Feb 2017 13:27:45 +0100 Content-Disposition: inline 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-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:13193 Archived-At: I am trying to format a timestamp from an api. It is sent in the format "2011-03-24T20:30:47Z" what I want to output 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->date 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-date-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-date-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-date-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