You can't subtract two dates written in a YYYYMMDD format. For example
20150907 - 20140907 obviously yields 10000 instead of 365.
20150907 - 20150907 does yield 0 — it's a valid way to test for equality, except that you could just test equality directly instead of calculating the subtraction. If you're getting
-20150907, it's because the code isn't what you showed, and
v_sysdate contains extra characters (other than whitespace and digits).
The sane way to manipulate dates is to convert them into a simple numeric format: number of time units since a fixed origin (an epoch). In the Unix world, the standard unit is seconds (like in SI) and the epoch is 1970-01-01.
GNU utilities such as
stat print dates in seconds since the epoch with the
%s format. Use this format until you need to pretty-print it. To pass
date a date in this format, put
@ before the number of seconds.
v_date=$(stat -c '%Z' file)
date -d "@$v_date" +'File ctime: %Y%M%D'
date -d "@$v_sysdate" +'Current time: %Y%M%D'
echo "$v_date_difference seconds elapsed"
echo "$((v_date_difference / 86400)) days elapsed"
Note that this calculates the number of days between the two times. For example, between yesterday 23:59 and today 00:01, this shows a difference of 0 days. If you need the difference between two dates, ignoring the time of day, you can use a reference time during the day.
file_midday_time=$(date +%s -d "$(date '+%Y-%m-%d 12:00' -d "@$(stat -c %Z file)")")
current_midday_time=$(date +%s -d "today 12:00")
day_difference=$(((file_midday_time - current_midday_time + 7200) / 86400))
Adding a number between 3601 and 86399 ensures that one day is accounted for even on the day clocks switch from normal time to daylights saving time (that day only lasts 23 hours).