public static int getWeeksSinceEpochFromJulianDay(int julianDay, int firstDayOfWeek) {
        int diff = Time.THURSDAY - firstDayOfWeek;
        if (diff < 0) {
            diff += 7;
        }
        int refDay = Time.EPOCH_JULIAN_DAY - diff;
        return (julianDay - refDay) / 7;
    }
public static int getWeeksSinceEpochFromJulianDay ( int julianDay , int firstDayOfWeek ) { int diff = Time . THURSDAY - firstDayOfWeek ; if ( diff < 0 ) { diff += 7 ; } int refDay = Time . EPOCH_JULIAN_DAY - diff ; return ( julianDay - refDay ) / 7 ; }
Returns the week since {@link Time#EPOCH_JULIAN_DAY} (Jan 1, 1970)
adjusted for first day of week.
<p/>
This takes a julian day and the week start day and calculates which
week since {@link Time#EPOCH_JULIAN_DAY} that day occurs in, starting
at 0. *Do not* use this to compute the ISO week number for the year.

@param julianDay      The julian day to calculate the week number for
@param firstDayOfWeek Which week day is the first day of the week,
see {@link Time#SUNDAY}
@return Weeks since the epoch