Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Oct 2002 10:19:37 -0700 (PDT)
From:      Jens Schweikhardt <schweikh@FreeBSD.org>
To:        zong.li@attbi.com, schweikh@FreeBSD.org, freebsd-bugs@FreeBSD.org
Subject:   Re: misc/43957: The "date" command takes invalid input when it is used to set system date or clock.
Message-ID:  <200210121719.g9CHJbiW033402@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
Synopsis: The "date" command takes invalid input when it is used to set system date or clock.

State-Changed-From-To: open->closed
State-Changed-By: schweikh
State-Changed-When: Sat Oct 12 10:12:57 PDT 2002
State-Changed-Why: 
Not a bug. You specify an invalid date (Nov 31). Technically
this is a case of "undefined behavior". In particular, turning
Nov 31 to Dec 1 could even be regarded as a feature: it is
consistent with the normalization done by mktime(3):

 The original values of the tm_wday and tm_yday components of the struc-
 ture are ignored, and the original values of the other components are not
 restricted to their normal ranges, and will be normalized if needed.  For
 example, October 40 is changed into November 9, a tm_hour of -1 means 1
 hour before midnight, tm_mday of 0 means the day preceding the current
 month, and tm_mon of -2 means 2 months before January of tm_year.

http://www.freebsd.org/cgi/query-pr.cgi?pr=43957

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?200210121719.g9CHJbiW033402>