From hausen@punkt.de Mon Apr  5 09:25:33 1999
Return-Path: <hausen@punkt.de>
Received: from hugo10.ka.punkt.de (hugo10.ka.punkt.de [194.77.233.242])
	by hub.freebsd.org (Postfix) with ESMTP id B0C1F154AC
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 Apr 1999 09:25:26 -0700 (PDT)
	(envelope-from hausen@punkt.de)
Received: (from ry93@localhost)
	by hugo10.ka.punkt.de (8.8.8/8.8.7) id SAA14456;
	Mon, 5 Apr 1999 18:23:24 +0200 (CEST)
	(envelope-from ry93)
Message-Id: <199904051623.SAA14456@hugo10.ka.punkt.de>
Date: Mon, 5 Apr 1999 18:23:24 +0200 (CEST)
From: hausen@punkt.de
Reply-To: hausen@punkt.de
To: FreeBSD-gnats-submit@freebsd.org
Cc: egeling@punkt.de, hausen@punkt.de
Subject: date -v gets confused when dailight saving time is active
X-Send-Pr-Version: 3.2

>Number:         10963
>Category:       bin
>Synopsis:       date -v dosen't quite work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr  5 09:30:01 PDT 1999
>Closed-Date:    Tue Apr 4 19:00:04 PDT 2000
>Last-Modified:  Tue Apr  4 19:00:23 PDT 2000
>Originator:     Patrick M. Hausen
>Release:        FreeBSD 2.2.7-RELEASE through 3.1-RELEASE (tested)
>Organization:
WEB Internet Services Systemhaus GmbH
>Environment:

	/etc/localtime set for Germany, switching to dailight saving
	on the last Sunday of March

>Description:

	I do some date manipulation in /bin/sh scripts for our
	IP accounting system. One particular script is run right
	after midnight to sum up the traffic values for certain
	router ports. On the first of April I got completely bogus
	values. Looks like /bin/date has got April Fool's Day functionality
	;-)

	The script gets the start and end date for it's calculations
	like this:

	today=`date +%Y-%m-%d`
	yesterday=`date -v-1d +%Y-%m-%d`
	day1=`date -v-1d -v1d +%Y-%m-%d`

	Then it sums up everything from $day1, i.e. the 1st of the
	current (in terms of "yesterday", since the script runs past
	midnight) month, up to $yesterday.

	This gave - as stated - bogus results on the 1st of April.

>How-To-Repeat:

	Set timezone for Germany

	ardbeg# date 9904010001
	Thu  1 Apr 00:01:00 CEST 1999

	ardbeg# date -v-1d
	Sun 28 Feb 23:02:29 CET 1999

	Now, that should clearly read "31 Mar", not "28 Feb".

>Fix:
	
	dunno

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: brian 
Responsible-Changed-When: Mon Apr 5 17:38:34 PDT 1999 
Responsible-Changed-Why:  
This is mine I guess. 

From: "Patrick M. Hausen" <hausen@punkt.de>
To: freebsd-gnats-submit@FreeBSD.org
Cc: hausen@punkt.de
Subject: Re: bin/10963: date -v dosen't quite work
Date: Tue, 4 Apr 2000 18:23:48 +0200 (CEST)

 Hi Brian!
 
 I'm sorry to bug you again but ...
 
 ardbeg# date 200004010001
 Sat Apr  1 00:01:00 CEST 2000
 ardbeg# date -v-1d
 Tue Feb 29 23:01:11 CET 2000
 
 
 Regards,
 Patrick
 -- 
 --- WEB ISS GmbH - Scheffelstr. 17a - 76135 Karlsruhe - 0721/9109-0 ---
 ------ Patrick M. Hausen - Technical Director - hausen@punkt.de -------
 "Contrary to popular belief, penguins are not the salvation of modern
  technology.  Neither do they throw parties for the urban proletariat."
 

From: "Patrick M. Hausen" <hausen@punkt.de>
To: hausen@punkt.de (Patrick M. Hausen)
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/10963: date -v dosen't quite work
Date: Tue, 4 Apr 2000 18:26:45 +0200 (CEST)

 > ardbeg# date 200004010001
 > Sat Apr  1 00:01:00 CEST 2000
 > ardbeg# date -v-1d
 > Tue Feb 29 23:01:11 CET 2000
 
 Ooops, forgot:
 
 ardbeg# uname -a
 FreeBSD ardbeg.komma.de 4.0-STABLE FreeBSD 4.0-STABLE #16: Sat Apr  1 16:29:45 CEST 2000     root@ardbeg.komma.de:/usr/src/sys/compile/ARDBEG  i386
 
 Patrick
 
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Tue Apr 4 19:00:04 PDT 2000 
State-Changed-Why:  
Fixed with vary.c v1.9 
>Unformatted:
