bash variable with the value
2019-08-15, is there some utility that can convert that date to the format
August 15, 2019?
On Linux, or any system that uses GNU
$ thedate=2019-08-15 $ date -d "$thedate" +'%B %e, %Y' August 15, 2019
On macOS, OpenBSD and FreeBSD, where GNU
date is not available by default:
$ thedate=2019-08-15 $ date -j -f '%Y-%m-%d' "$thedate" +'%B %e, %Y' August 15, 2019
-j option disables setting the system clock, and the format string used with
-f describes the input date format (should be a
strptime(3) format string describing the format used by your variable's value). Then follows the value of your variable and the format that you want your output to be in (should be a
strftime(3) format string).
NetBSD users may use something similar to the above but without the
-f input_fmt option, as their
date implementation uses
parsedate(3). Note also the
-d option to specify the input date string:
$ thedate=2019-08-15 $ date -j -d "$thedate" +'%B %e, %Y' August 15, 2019
See also the manual for
date on your system.
Assuming that you have access to GNU
date, something along
$ date --date="2019-08-15" "+%B %d, %Y" August 15, 2019
Check the manpage of date (