I got these 2 little functions to get the weekday and the date of today:
public String giveDate() {
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy");
return sdf.format(cal.getTime()).substring(0,1).toUpperCase() + sdf.format(cal.getTime()).substring(1);
}
public String giveDay() {
SimpleDateFormat sdf = new SimpleDateFormat("EEEE");
Date d = new Date();
String dayOfTheWeek = sdf.format(d);
return dayOfTheWeek.substring(0,1).toUpperCase() + dayOfTheWeek.substring(1);
}
Is there any addition to my current functions to get the result of the following days?
Example of what I mean:
giveDate(0)
and giveDay(0)
will result in today.
giveDate(1)
and giveDay(1)
will result in tomorrow etc..
Thanks in advance