On my home computer (Xubuntu 14.04), I have
zev@home:~$ date +%F 2015-10-05 zev@home:~$ date +%F -d "next Monday" 2015-10-12
whereas at work (Red Hat 5.11), I have
zev@work:~$ date +%F 2015-10-05 zev@work:~$ date +%F -d "next Monday" 2015-10-05
(Note that today is Monday.) My initial guess was that the different interpretations of the phrase next Monday
are due to the systems having different versions of the coreutil date
:
zev@home:~$ date --version | head -2 date (GNU coreutils) 8.21 Copyright (C) 2013 Free Software Foundation, Inc. zev@work:~$ date --version | head -2 date (GNU coreutils) 5.97 Copyright (C) 2006 Free Software Foundation, Inc.
My questions are:
-
Is the difference in versions of the
date
program the sole cause, or is there something else about a system that will affect its interpretation of date strings? -
How can I know whether a system will have one interpretation or the other, without running the commands to check directly? If the only thing that affects the outcome is the version of
date
, then according to this unix.SE thread (Which version of X introduced feature Y?) I should be able to find which version introduced the new behavior in a changelog for thedate
program, but I can't find anything remotely like that here (maybe I'm just confused).
Best Answer
I did
rpm -qfl /bin/date
and looked through the list of files for a changelog, and found/usr/share/doc/coreutils/NEWS
and the following paragraph: