I need to set the date of a Linux box with a string I get from a program. This string is formatted as ddmmyy. Is it possible to use that directly or do I need to reformat it first?
Currently I have tried the following without any luck:
date +%d%m%y -s "071012"
This should be 7. Oct 2012 but it is interpreted backwards and then becomes 12. Oct 07.
If I try to tell date to use the reverse format:
date +%y%m%d -s "071012"
it will still read it as 12. Oct 07. I would rather not have reverse the string because I thought date would be able to take care of that.