GNU bug report logs - #26902
date: improve error messages for invalid dates

Previous Next

Package: coreutils;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Fri, 12 May 2017 22:42:01 UTC

Severity: wishlist

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-coreutils <at> gnu.org
Subject: good invalid dates vs. bad invalid dates
Date: Sat, 13 May 2017 01:26:49 +0800
Can you please don't say "invalid date" for everything invalid.

$ date -d @1494439601675485
date: invalid date ‘@1494439601675485’
$ date -d 1494439601675485sec
date: invalid date ‘1494439601675485sec’
$ date -d 1494439601675485seconds
date: invalid date ‘1494439601675485seconds’
$ date -d @1494439601675485
date: invalid date ‘@1494439601675485’
$ date -d @1494439601675
date: invalid date ‘@1494439601675’
$ date -d @1
四  1月  1 08:00:01 CST 1970
$ date -d @149443960167
date: invalid date ‘@149443960167’
$ date -d @14944396016
date: invalid date ‘@14944396016’
$ date -d @1494439601
四  5月 11 02:06:41 CST 2017
$ date -d @zzzzzz
date: invalid date ‘@zzzzzz’

On (info "(coreutils) Seconds since the Epoch") it says

      Traditional Unix systems count seconds with 32-bit two’s-complement
   integers and can represent times from 1901-12-13 20:45:52 through
   2038-01-19 03:14:07 UTC.  More modern systems use 64-bit counts of
   seconds with nanosecond subcounts, and can represent all the times in

Please catch the cases where the user merely has entered too many digits
for the computer in question, and say
date: too far into the future.
or
date: too far into the future for current computer.
or
date: invalid date: too far into the future for current computer.

Please don't just give the same message that you give if the user hasn't
even entered one digit.




This bug report was last modified 6 years and 167 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.