$ date -d '2005-06-30' +'%a %F' Thu 2005-06-30
See man date for other format options.
This option is available for Linux, but not for Darwin. In Darwin, you can use the following syntax instead:
date -j -f "%Y-%m-%d" 2006-06-30 +"%a %F"
The -f argument indicates the input format, and the + argument indicates the output format.
As indicated by another poster below, it would be wise for you to use% u (the numeric day of the week) rather than% a to avoid localization problems.
source share