In this case use variable expansion to reformat it to your needs:
yourdate="$(ssh <your ssh-command)"
echo $yourdate
19-01-2017 00:05:01"
mytime="${yourdate#* }" # extract "00:05:01"
yourdate="${yourdate% *}" # remove time from date, leaving "19-01-2017"
myyear="${yourdate##*-}" # extract the year "2017"
yourdate="${yourdate%-*}" # remove "-${myyear}" from the date leaving "19-01"
mymonth="${yourdate##*-}" # extract the month "01"
yourdate="${yourdate%-*}" # remove "-${mymonth}" from the date leaving "19"
myday="${yourdate}"
Using the variables set this way you can easily set your date using a different format.
The great thing is that in utilities like "date", "sort" there is a "--debug" option that helps to work on the bugs.
In the output with this option, you can immediately see in the first line where the error:
parsed date part: (Y-M-D) 0019-01-2017
warning: adjusting year value 19 to 2019