I wanted to add one day to a date in bash using date command. The input format of date is like this : 20130101 which means 01 January 2013
I use this command to accomplish that:
date -d "20130101 +1 day" +%Y%m%d
Everything went well till it reached this date: 20130322
and then it returned this error:
date: invalid date ‘20130322 +1 day’
I tried the code with some other similar dates, some of them were fine and some were not! Is it normal? I mean maybe it is somehow related to numeral system converting like the one that happens when a for loop reach 9th loop. How can I properly workaround the problem?
date -d "20130101 +1 day" +%Y%m%danddate -d "20130322 +1 day" +%Y%m%dwith date command from GNU coreutils version 5.97.date (GNU coreutils) 8.23... strange. I never would have thought that there may be such bug..