"Thirty days hath September, April, June and November..."
There is no 31st April. $ date -d '-1 month' Tue May 1 15:28:44 BST 2012 $ date -d '-2 month' Sat Mar 31 15:28:52 BST 2012 Jonathan. On 31/05/12 15:22, Frank Bulk wrote:
I noticed a daily script was giving out some incorrect output, and looking at it more closely I saw that the date function assumes a 30-day month: nagios:/# date Thu May 31 09:22:02 CDT 2012 nagios:/#nagios:/# date -d '-1 month' Tue May 1 09:19:54 CDT 2012 nagios:/# Shouldn't the output be April 31st? Frank _______________________________________________ Tech mailing list Tech@lists.lopsa.org https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech This list provided by the League of Professional System Administrators http://lopsa.org/
-- Jonathan Crompton _______________________________________________ Tech mailing list Tech@lists.lopsa.org https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech This list provided by the League of Professional System Administrators http://lopsa.org/