From owner-freebsd-bugs Mon Apr 5 9:32: 0 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id AF3F61547B for ; Mon, 5 Apr 1999 09:31:58 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id JAA70400; Mon, 5 Apr 1999 09:30:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from hugo10.ka.punkt.de (hugo10.ka.punkt.de [194.77.233.242]) by hub.freebsd.org (Postfix) with ESMTP id B0C1F154AC for ; 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 X-Send-Pr-Version: 3.2 Subject: bin/10963: date -v gets confused when dailight saving time is active Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 10963 >Category: bin >Synopsis: date -v dosen't quite work >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Apr 5 09:30:01 PDT 1999 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message