Jukka Inkeri
2014-11-04 18:03:10 UTC
datestr="2014-11-03"
printf "%(%d)T\n" "$datestr"
03
# using + (not -f) output is not so good
date '+%d' -d "$datestr"
04
03
# correct output is 03 as ex. debian bin/date version do it.
/bin/date '+%d' -d "$datestr"
03
# ast date using -f works okay
date -f '%d' -d "$datestr"
03
-jukka-
PS. I haven't tested older ast date, but older ksh works fine.
printf "%(%d)T\n" "$datestr"
03
# using + (not -f) output is not so good
date '+%d' -d "$datestr"
04
03
# correct output is 03 as ex. debian bin/date version do it.
/bin/date '+%d' -d "$datestr"
03
# ast date using -f works okay
date -f '%d' -d "$datestr"
03
-jukka-
PS. I haven't tested older ast date, but older ksh works fine.