How would you parse a date in bash, with separate fields (years, months, days, hours, minutes, seconds) into different variables?
The date format is: YYYY-MM-D
YYYY-MM-D
have you tried using cut? something like this: dayofweek=date|cut -d" " -f1
date|cut -d" " -f1