Your script will give the wrong answers around midnight on 31st December as you are calculating the year from the system date and not the file date.
So if your file is received at 23:58 on 31st December and your script runs at 00:05 on 1st January you'll get "Dec 31 23:58 2015" as the result, so your file will be almost a year in the future!
Depending on your distribution and version of ls you may find it supports the --time-style option. If it does then:
lsdate.sh
Code:
#!/bin/bash
FILE=$1
DATE=$(ls -l --time-style=+%d%m%Y" "%H:%M ${FILE} | cut -d " " -f 6,7)
echo ${FILE} ${DATE}
Gives:
Code:
[tt@audi ~]# ls -l phpinst.sh
-rwxr-xr-x 1 tt tt 192 Nov 9 2013 phpinst.sh
[tt@audi ~]# ./lsdate.sh phpinst.sh
phpinst.sh 09112013 14:23