I understand that command date -d 20170712 validates and return the date in string form as Wed Jul 12 00:00:00 PDT 2017.The questions I have are:How does date know that format in which I gave the string (in this case Year as 2107, Month as Jul and Day as 12)?Also what if I want to pass 20171307 and want to tell the function that day is 13th and month is Jul?  Is there a way to specify the format of the string I pass to date command?
How to specify the date format to the function
linux;date