summaryrefslogtreecommitdiff
path: root/lib/getdate.y
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-03-15 08:37:03 +0000
committerJim Meyering <jim@meyering.net>2004-03-15 08:37:03 +0000
commitfae8b8505c7a4c2202d79619b482ff6b70490bf7 (patch)
tree83d709e3742bba0b2d46511f841450432e6d03d6 /lib/getdate.y
parentb9ccb4b8e8b44f128ee0fa9c4dac0b83007c6604 (diff)
downloadcoreutils-fae8b8505c7a4c2202d79619b482ff6b70490bf7.tar.xz
`date --date="21:04 +0100" +%S' would print the seconds value
from the current time, rather than `00'. For a date string like `10:23 +0100', set the number of seconds to zero. Reported by Marc Haber.
Diffstat (limited to 'lib/getdate.y')
-rw-r--r--lib/getdate.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/getdate.y b/lib/getdate.y
index 40fd4e0fe..7725908a0 100644
--- a/lib/getdate.y
+++ b/lib/getdate.y
@@ -1,6 +1,6 @@
%{
/* Parse a string into an internal time stamp.
- Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -220,6 +220,7 @@ time:
{
PC.hour = $1.value;
PC.minutes = $3.value;
+ PC.seconds = 0;
PC.meridian = MER24;
PC.zones_seen++;
PC.time_zone = $4.value % 100 + ($4.value / 100) * 60;