After a little research I discovered some Calendar methods that were pretty nice.
Date date = new Date(); int daysSinceSeen = - ( rand.nextInt() % 365 ); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.DATE, daysSinceSeen);
How could this code be returning a date in 2010? Do I have a bug that I can't see? The Javadoc for the add method says to use Calendar.DAY_OF_MONTH, but that also returns dates in 2010. Hm.