code: public static int dayOfWeek(long day) {
          long[] remainder = new long[1];
          floorDivide(day + Calendar.THURSDAY, 7, remainder);
          int dayOfWeek = (int)remainder[0];
          dayOfWeek = (dayOfWeek == 0) ? 7 : dayOfWeek;
          return dayOfWeek;
      }
docs: Return the day of week on the 1970-epoch day
  @param day the 1970-epoch day (integral value)
  @return the day of week