Since Time class is deprecated, I can no longer use the getJulianDay() in the following function. I want to use Calender or GregorianCalender class to achieve the same. I partly got my answer from [question]:Time getJulianDay() deprecated which alternatives to convert date to julian and vice versa? but I'm new to such classes so I don't know how to transform the GregorianCalender to long so that I can return it in the function. How can I get the Julian Date? Thanks!
public static long normalizeDate(long startDate) {
// normalize the start date to the beginning of the (UTC) day
Time time = new Time();
time.set(startDate);
int julianDay = Time.getJulianDay(startDate, time.gmtoff);
return time.setJulianDay(julianDay);
}