delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/07/14/10:09:56

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=date:from:to:cc:subject:message-id:mail-followup-to:references
:mime-version:content-type:content-disposition:in-reply-to
:user-agent;
bh=/MxLuYE+StRzCJxa7D0gp9wEGiFBvRZY+CMYODNetVI=;
b=vwextvixm7kRxpv7To3o4SbcqKKgLk1p8fjWxmFRdx87C0mWXucQTi2SHMJCQekuy4
Gyw+ndOEPSRgbyntDpDw5LjPSGAVmqbwX5DAWlL3TR0768A29HggZShjU4b4wXYdbfLq
QEgTZYFafa1aWEZv6vOVEtdiBXTIXNoMon3cjau7Myv11deOIRRIQHWvmQyr0ZVoPHto
UTl+H4HI1W+S7NoCmMHzOk227ycKVckwfSsT27iQKwbMfxg/KC70Jztf9oSY7tUmPL/8
tRy2RdfvgrIehvLoLrNk+akT+Kj6y8R7xHdPsfCcX3coUQUPUojWY2IBWtvbv1x0GT1s
/jYw==
X-Received: by 10.112.46.130 with SMTP id v2mr30871025lbm.119.1436882955373;
Tue, 14 Jul 2015 07:09:15 -0700 (PDT)
Date: Tue, 14 Jul 2015 17:09:11 +0300
From: "Vladimir Zhbanov (vzhbanov AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
To: geda-developers AT lists DOT launchpad DOT net
Cc: geda-user AT delorie DOT com
Subject: [geda-user] Re: geda-gaf on FreeBSD and probably other architectures
Message-ID: <20150714140911.GA18818@localhost.localdomain>
Mail-Followup-To: geda-developers AT lists DOT launchpad DOT net,
geda-user AT delorie DOT com
References: <20150714103959 DOT GA17565 AT localhost DOT localdomain>
MIME-Version: 1.0
In-Reply-To: <20150714103959.GA17565@localhost.localdomain>
User-Agent: Mutt/1.5.23 (2014-03-12)
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

OK, the line in question was
  d=`LANG=C date -d $(DATE_VERSION) "+%B %-d, %Y"` ; \

I've written two scripts, one is combination of sed and awk:

  echo DATE_VERSION | sed 's/\(....\)\(..\)\(..\)/\1 \2 \3 00 00 00/' |
                      LANG=C awk '{print (strftime ("%B %-d, %Y", mktime ($0)))}'

and the other is in Guile:

  (setlocale LC_ALL "C")
  (display
    (strftime "%B %-d, %Y"
      (car (strptime "%Y%m%d" (cadr (program-arguments))))))

which will be invoked then something like this
  guile date.scm DATE_VERSION


Which would be better to use?

Any simplifications/improvements are apreciated.

Cheers,
  Vladimir

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019