I often find myself needing to convert from one type of time to another, and haven't found a way I'm consistently happy with. Every time I do a quick google search, I come up with different (sometimes painfully complex) answers.
I'm happy with
date -d "Sep 5 1986" "+%s"
for converting a standard date to epoch time, but I can't seem to make the reverse work (and the man pages I've browsed aren't helping much.)
date -d "526276800" "+%m/%d/%y"
yields an error on my RHEL 5 install.
Can the community offer me some strategies for easily converting back and forth? I'll take all forms: awk, perl, date. What are the pros and cons of each method?