This is posted in the Shell Programming and Scripting forum, but the way you are invoking your functions looks like you want to write a C function (except for using single quotes instead of double quotes surrounding strings).
If you are trying to do this in a shell function, it might not be too hard if you have GNU date with the -d "date" option or a recent ksh93 with printf '%(format)T" "date" although the documentation about the recognized formats for the date operand is sparse for both.
If you're trying to do it in C, look at the strptime and strftime function man pages.
I don't have GNU date on my system. The Linux date man page available on this forum says:
Since you have access to the GNU date utility, I assume you can find "the info documentation" that fully describes the date string format on your system. It isn't available on my system.
The main problem you'll need to resolve is how to tell the difference between an MMDD versus DDMM input or how to rearrange your input into the order that date will interpret correctly for the input format you're given.