delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/01/04/13:48:04

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Date: Mon, 04 Jan 2010 13:47:48 -0500
From: "cygwin at sipxx.com" <cygwin AT sipxx DOT com>
Subject: Re: Incorrect year in date function.
In-reply-to: <hhtcmj$j5r$1@ger.gmane.org>
To: cygwin AT cygwin DOT com
Reply-to: cygwin AT sipxx DOT com
Message-id: <4B4237D4.7080600@sipxx.com>
MIME-version: 1.0
References: <hhtcmj$j5r$1 AT ger DOT gmane DOT org>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

The function worked quite correctly.
%g  is the year of the current ISO week number, that week started in 
2009, not 2010.
use %y if you want the year of the current date.





Jacob Jacobson wrote:
>
> I am curious as to why this happened.
>
> I was at work yesterday and created a file. The name of the file
> is created using the Cygwin date function.
>
> REV=$(date +rev-%b-%d-%g)
> APPNAME="$1-$REV.img"
>
> When I did a "ls" this morning, I noticed that the year was wrong
> on the file yesterday but is correct today (on a new file created
> today using the same script). I have a windows XP machine and the
> Cygwin version is quite recent.
>
> 2010-01-04 11:55 debug-rev-Jan-04-10.img
> 2010-01-03 12:34 debug-rev-Jan-03-09.img
>
>
> -- 
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>


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

- Raw text -


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