Date: Mon, 5 Apr 1999 18:23:24 +0200 (CEST) From: hausen@punkt.de To: FreeBSD-gnats-submit@freebsd.org Cc: egeling@punkt.de, hausen@punkt.de Subject: bin/10963: date -v gets confused when dailight saving time is active Message-ID: <199904051623.SAA14456@hugo10.ka.punkt.de>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904051623.SAA14456>