That is the correct way to subtract days.
Note that 365 days does not always equal one year because of leap days. calendar.add(Calendar.YEAR, -1)
would subtract one year correctly.
You also may want to use Joda Time-library instead of java.util.Date
and java.util.Calendar
. Joda Time is a much nicer API for handling times and dates.