Date Conversion : Month Name --> Number
Hi,
I have a script (Bash) that grabs a month from a specific file, however in that file it is listed as a name rather then a number (April May June etc.). Is there an easy way to convert this to a number (04 05 06..) - or is it a matter of creating a script that codifies each name to a number, i.e
if [ "$month" == "April" ]; then
monthn=04
elif [ "$month" == "May" ]; then
monthn=05
....
Any assistance would be greatly appreciated.
|