delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/08/12/01:57:22

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <48A12609.C1A1929B@dessent.net>
Date: Mon, 11 Aug 2008 22:56:25 -0700
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: changed behaviour in date command
References: <1454 DOT 81 DOT 17 DOT 205 DOT 14 DOT 1218517172 DOT squirrel AT webmail2 DOT nebula DOT fi>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Nicholas Volk wrote:

> After I updated cygwin today (bash updated) this no longer works as such,
> because the behaviour of %k has changed: instead of the usual "07" I now
> get " 7". Is this intentional? At least in my opinion the new behaviour is
> worse than the original.

The date command is part of coreutils and updating bash should have
nothing to do with it.

> (The fix itself is easy: tar -jcvf api-`date '+%Y%m%d%k%M' | tr ' '
> '0'`.tbz files )

Why not just use %H?  The entire purpose of %k as far as I can tell is
to have an alternative to %H that is space padded instead of zero
padded.  And %H is standard while %k is a GNU extension.

I spent a little bit of time in gitk trying to see if anything had
changed recently in coreutils or gnulib, but going all the way back to
the initial version of lib/strftime.c in gnulib from 1992-11-01, %k has
always meant a space padded version of %H:
<http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/strftime.c;h=cc4953e68aaf9bc2cabdc9521ae2d99c220374bf;hb=43e78b970f396160a887c9da94531569faeda8a0>.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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