GNU bug report logs - #16386
maybe a small Bug in date?

Previous Next

Package: coreutils;

Reported by: <thomas.dohl <at> soluvia.de>

Date: Tue, 7 Jan 2014 16:48:05 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16386 in the body.
You can then email your comments to 16386 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#16386; Package coreutils. (Tue, 07 Jan 2014 16:48:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to <thomas.dohl <at> soluvia.de>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 07 Jan 2014 16:48:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <thomas.dohl <at> soluvia.de>
To: <bug-coreutils <at> gnu.org>
Subject: maybe a small Bug in date?
Date: Tue, 7 Jan 2014 15:37:51 +0000
[Message part 1 (text/plain, inline)]
Hello,

could this be a bug in date?
date --version
	date (GNU coreutils) 8.4
	Copyright (C) 2010 Free Software Foundation, Inc.
	License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
	This is free software: you are free to change and redistribute it.
	There is NO WARRANTY, to the extent permitted by law.

	Written by David MacKenzie.

bug report:
------------------------------------------------------
OK: 		date 						-> Tue Jan
7 16:27:06 CET 2014

OK:		date +%V_%Y -d "last wednesday" 		-> 01_2014
OK: 		date +%V_%Y -d "last wednesday +1 week"	-> 02_2014
...
OK: 		date +%V_%Y -d "last wednesday +51 week"	-> 52_2014
WRONG:  	date +%V_%Y -d "last wednesday +52 week"	-> 01_2014
This should be 01_2015:					            ^^^^
OK: 		date +%V_%Y -d "last wednesday +53 week"	-> 02_2015
OK: 		date +%V_%Y -d "last wednesday +54 week"	-> 03_2015
...



My system:
uname -a
	Linux ... 2.6.32-431.1.2.0.1.el6.x86_64 #1 SMP Fri Dec 13 13:06:13
UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
less /etc/redhat-release
	CentOS release 6.5 (Final)


Thanks and best regards.
Thomas Dohl


Mit freundlichen Grüßen,
Soluvia IT-Services GmbH
Netz & Security / Rechenzentrum & Infrastruktur
Thomas Dohl

Telefon: +49 (0)621-290-3839
Fax:      +49 (0)621-290-2677
E-Mail:  thomas.dohl <at> soluvia.de
Internet: www.soluvia-it-services.de

Soluvia IT-Services GmbH . Uhlenkrog 32 . 24113 Kiel
Büro Mannheim: Luisenring 49, 68159 Mannheim
Handelsregister-Nr. HRB 7458Ki, Sitz und Amtsgericht: Kiel
Geschäftsführer: Dr. Dirk Bevers, Dr. Simon Kalvoda

Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen
enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser E-Mail ist nicht gestattet.



[smime.p7s (application/pkcs7-signature, attachment)]

Added tag(s) notabug. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Tue, 07 Jan 2014 17:12:02 GMT) Full text and rfc822 format available.

Reply sent to Eric Blake <eblake <at> redhat.com>:
You have taken responsibility. (Tue, 07 Jan 2014 17:12:02 GMT) Full text and rfc822 format available.

Notification sent to <thomas.dohl <at> soluvia.de>:
bug acknowledged by developer. (Tue, 07 Jan 2014 17:12:03 GMT) Full text and rfc822 format available.

Message #12 received at 16386-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: thomas.dohl <at> soluvia.de, 16386-done <at> debbugs.gnu.org
Subject: Re: bug#16386: maybe a small Bug in date?
Date: Tue, 07 Jan 2014 10:10:58 -0700
[Message part 1 (text/plain, inline)]
tag 16386 notabug
thanks

On 01/07/2014 08:37 AM, thomas.dohl <at> soluvia.de wrote:
> Hello,
> 
> could this be a bug in date?

Thanks for the report.  However, this is not a bug in date, but a
misunderstanding on your part, covered in our FAQ.

https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-command-is-not-working-right_002e

> 
> OK:		date +%V_%Y -d "last wednesday" 		-> 01_2014

Do not mix %V and %Y.  %V goes with %G, %Y goes with %U or %W.

> OK: 		date +%V_%Y -d "last wednesday +1 week"	-> 02_2014
> ...
> OK: 		date +%V_%Y -d "last wednesday +51 week"	-> 52_2014
> WRONG:  	date +%V_%Y -d "last wednesday +52 week"	-> 01_2014
> This should be 01_2015:					            ^^^^

No, you are using the wrong format string.  When you mix two different
formats that use different notions of when a year rolls over, you are
bound to get confusing results.  But those results are correct, once you
re-read the documentation of what those format strings represent.

> Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen

This disclaimer is unenforceable on a publicly-archived mailing list.
It is considered poor email etiquette to open source lists to use your
employer's email if they are going to tack on garbage.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 05 Feb 2014 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 221 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.