Bash date formatting error? -


i odd behavior date function doesn't convert date correctly.

_startdate="07/14/2015 00:00:00 utc" echo $_startdate  # 07/14/2015 00:00:00 utc date=$(date +%y%m%d -d "$_startdate") echo $date        # 20150713 

as can see, when try convert format of date, takes off day _startdate. thought weird round-off error, tried _startdate="07/14/2015 00:00:01 utc", echo $date still echoes 20150713. idea why happens?


Comments