Date Format MM/DD/YYYY

I am changing epoch times to dates. I was able to do the following:

echo "$varx" | gawk '{print strftime("%c", $0)}'
Mon Dec 31 16:26:40 2012

This changes the epoch date (which is what varx is) into localtime.
However, my problem is that I only want 12/31/2012 and not the Mon Dec 31 part. Does anyone know how to format a bash date as 12/31/2012? I do not have access to date -d option on my system. Any help is greatly appreciated!

man strftime is your friend:

1 Like

Thanks, the man page had everything I needed! You are right, it is our friend!