code: public static long getMonthStartTime(final long time) {
          final Calendar start = Calendar.getInstance();
          start.setTimeInMillis(time);
          final int year = start.get(Calendar.YEAR);
          final int month = start.get(Calendar.MONTH);
          start.set(year, month, 1, 0, 0, 0);
          start.set(Calendar.MILLISECOND, 0);
  
          return start.getTimeInMillis();
      }
docs: Gets the month start time with the specified time.
  
  @param time the specified time
  @return month start time