While referring to a particular course I came across the following code to retrieve the current day:
int julianStartDay = Time.getJulianDay(System.currentTimeMillis(), dayTime.gmtoff);
long dateTime;
dateTime = dayTime.setJulianDay(julianStartDay);
day = getReadableDateString(dateTime);
private String getReadableDateString(long time){
SimpleDateFormat shortenedDateFormat = new SimpleDateFormat("E MMM d");
return shortenedDateFormat.format(time);
}
My doubt is why are we using this julian method instead of just directly extracting the day from the Date class object which gives the current date and time.