I would like to convert the human readable date into YYYYMMDD. Just wondering how can I do this. Thanks.
Input Date :-
Sep 30, 2016 11:20:34 AM
Output Date :-
20160930112034
5 (Friday)
I would like to convert the human readable date into YYYYMMDD. Just wondering how can I do this. Thanks.
Input Date :-
Sep 30, 2016 11:20:34 AM
Output Date :-
20160930112034
5 (Friday)
This command will have exact output you have posted at Ubuntu 16.04:
$ date -d"Sep 30, 2016 11:20:34 AM" "+%Y%m%d%H%M%S %n%u (%A)"
20160930112034
5 (Friday)
According to this question you might need to adjust it for Mac os. Check this command for ex.:
$ date -j -vJulm -v20d -v1999y '+%A'
Here is manual for date command for Mac OS X.
Here is a Bash solution:
$ date -d"Sep 30, 2016 11:20:34 AM" "+%Y%m%d - %A"
20160930 - Friday