Date functions: showdate


showdate() #@ Convert ISO date to English date
{          #@ USAGE: showdate ISO_DATE [VAR]
  local _monthname=( '' January February March April May June July
                        August September October November December )
  local _iso=$1 _var=$2
  local _year _month _day _date
  IFS=${_iso//[0-9]} read _year _month _day <<< "$_iso"
  _date="${_day#0} ${_monthname[10#$_month]} $_year"
  ((debug)) &&
    pr1 "year=$_year" "month=$_month" "day=$_day" "date=$_date"
  is_var "$_var" && printf -v "$_var" %s "$_date" || printf '%s\n' "$_date"
}