you normally should not try to parse the output of 'ls -l' like that: there are too many things that could go wrong.
Here is a slightly less dangerous approach
for f in * ; do
d=$(stat --printf %y $f | cut -f1 -d' ' | tr '-' '/')
if [ ! -d $dd ] ; then
mkdir -p $dd
mv $f $dd
This loops over all the files in the directory and puts them in /path/to/somwhere/YYYY/MM/DD/. Where the Ys, Ms, and Ds correspond to the date. Note that this is untested.