summaryrefslogtreecommitdiffstats
path: root/bin/date
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-05-17 15:20:15 +0000
committerru <ru@FreeBSD.org>2001-05-17 15:20:15 +0000
commit1ea506c6d50714fd6bf6e73f85fe3a892dcdd2f1 (patch)
tree2ff33f35fea17d995b62ff9807c6a9e92a9ec61b /bin/date
parentc632b830a96d3c5080f091421f5887305deb72b0 (diff)
downloadFreeBSD-src-1ea506c6d50714fd6bf6e73f85fe3a892dcdd2f1.zip
FreeBSD-src-1ea506c6d50714fd6bf6e73f85fe3a892dcdd2f1.tar.gz
Fix an off-by-hour bug when crossing Daylight Saving Time boundary.
PR: bin/27399 Submitted by: "Crist J. Clark" <crist.clark@globalstar.com> MFC after: 3 days
Diffstat (limited to 'bin/date')
-rw-r--r--bin/date/date.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/date/date.c b/bin/date/date.c
index 99ebfe6..b7b1656 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -268,6 +268,9 @@ setthetime(fmt, p, jflag, nflag)
}
}
+ /* Let mktime() decide whether summer time is in effect. */
+ lt->tm_isdst = -1;
+
/* convert broken-down time to GMT clock time */
if ((tval = mktime(lt)) == -1)
errx(1, "nonexistent time");
OpenPOWER on IntegriCloud