Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Mar 2000 17:46:11 +0200 (CEST)
From:      Paul.Hernaus@nl.origin-it.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/17623: date(1) -v doesn't handle time changes (DST) correctly
Message-ID:  <20000327154611.70ACEA8C0@itchy.mpn.cp.philips.com>

next in thread | raw e-mail | index | archive | help

>Number:         17623
>Category:       bin
>Synopsis:       date(1) -v doesn't handle time changes (DST) correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 27 07:50:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Paul Hernaus
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Origin
>Environment:
All FreeBSD as far as I know

>Description:

Date adjustments with -v can result in an error because Daylight Savings
Time is handled incorrectly.

>How-To-Repeat:

[~] paul@itchy> date
Mon Mar 27 17:42:55 CEST 2000
[~] paul@itchy> date -v-38H
Sun Mar 26 03:42:59 CEST 2000
[~] paul@itchy> date -v-39H
-39H: Cannot apply date adjustment
usage: date [-nu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
            [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]

>Fix:
First convert the start date to UTC, then do the math, then convert
back to the desired time zone, just like GNU date does. The correct
result in this case would have been:

[~] paul@itchy> date -v-39H
Sun Mar 26 01:42:59 CET 2000

>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?20000327154611.70ACEA8C0>