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
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
dateprogram 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 the
dateprogram, but I can't find anything remotely like that here (maybe I'm just confused).