code: public static int getWeekDay(final long time) {
          final Calendar calendar = Calendar.getInstance();
          calendar.setTimeInMillis(time);
          int ret = calendar.get(Calendar.DAY_OF_WEEK) - 1;
          if (ret <= 0) {
              ret = 7;
          }
  
          return ret;
      }
docs: Gets the week day with the specified time.
  
  @param time the specified time
  @return week day