]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
`date --date="21:04 +0100" +%S' would print the seconds value
authorJim Meyering <jim@meyering.net>
Mon, 15 Mar 2004 08:37:03 +0000 (08:37 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 15 Mar 2004 08:37:03 +0000 (08:37 +0000)
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.

lib/getdate.y

index 40fd4e0fe4c969bb83237d380072216a6988a8ba..7725908a093819a8ab0fc93544dc4d9a52c13015 100644 (file)
@@ -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;