/*[deutsch]
<p>Setzt den Beginn des Kalendertages. </p>

@param   startOfDay      new start of day
@return  changed copy with the given start of day while this instance remains unaffected
@see     Attributes#START_OF_DAY
@since   3.11/4.8
176538
public ChronoFormatter<T> with(StartOfDay startOfDay) {

        if (startOfDay == null) {
            throw new NullPointerException("Missing start of day.");
        }

        return new ChronoFormatter<>(this, this.globalAttributes.withInternal(Attributes.START_OF_DAY, startOfDay));

    }
701140
public static int calendarDay2Day(int day) {
        switch (day) {
            case Calendar.SUNDAY:
                return SU;
            case Calendar.MONDAY:
                return MO;
            case Calendar.TUESDAY:
                return TU;
            case Calendar.WEDNESDAY:
                return WE;
            case Calendar.THURSDAY:
                return TH;
            case Calendar.FRIDAY:
                return FR;
            case Calendar.SATURDAY:
                return SA;
            default:
                throw new RuntimeException("bad day of week: " + day);
        }
    }
548076
def start_of_day(self) -> datetime:
        
        self.value = datetime(self.value.year, self.value.month, self.value.day)
        return self.value
1028370
public static Date getFirstDayFromCurrentWeek(Date d) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(d);        
        cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return cal.getTime();
    }
646696
void setDayOfMonth(String day) {

        final int i = CmsSerialDateUtil.toIntWithDefault(day, -1);
        if (m_model.getDayOfMonth() != i) {
            removeExceptionsOnChange(new Command() {

                public void execute() {

                    m_model.setDayOfMonth(i);
                    onValueChange();
                }
            });
        }
    }
743384
public static Date getStartOfWeek(Date date) {

        if (date == null)
            return null;

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.setFirstDayOfWeek(FIRST_DAY_OF_WEEK);
        calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);

        return calendar.getTime();
    }
359875
public static Date getDayStartDate(Date date)
   {
      if (date != null)
      {
         Calendar cal = popCalendar(date);
         cal.set(Calendar.HOUR_OF_DAY, 0);
         cal.set(Calendar.MINUTE, 0);
         cal.set(Calendar.SECOND, 0);
         cal.set(Calendar.MILLISECOND, 0);
         date = cal.getTime();
         pushCalendar(cal);
      }
      return (date);
   }
1184604
public boolean isSameDay(Calendar calendar) {
		Calendar c1 = asCalendar();
		return (c1.get(Calendar.ERA) == calendar.get(Calendar.ERA) &&
				c1.get(Calendar.YEAR) == calendar.get(Calendar.YEAR) &&
				c1.get(Calendar.DAY_OF_YEAR) == calendar.get(Calendar.DAY_OF_YEAR));
	}
605913
public static Calendar next(Calendar self) {
        Calendar result = (Calendar) self.clone();
        result.add(Calendar.DAY_OF_YEAR, 1);
        return result;
    }
97725
public static Date addDay(Date date1, int addDay) {
        Date resultDate = null;
        Calendar c = Calendar.getInstance();
        c.setTime(date1); // 设置当前日期
        c.add(Calendar.DATE, addDay); // 日期加1
        resultDate = c.getTime(); // 结果
        return resultDate;
    }
840371
public static Date toDateAddDaysSetOfWeek(int days, int dayOfWeek)
   {
	Calendar cal = Calendar.getInstance();
	
	cal.add(Calendar.DAY_OF_YEAR, days);
	
	
	return cal.getTime();
   }
928738
public Calendar getStart() {
		Calendar cal = Calendar.getInstance();
		cal.setTimeInMillis(start);
		return cal;
	}
624224
public static Date dateIncreaseByDay(Date date, int days) {

        Calendar cal = GregorianCalendar.getInstance();
        cal.setTime(date);
        cal.add(Calendar.DATE, days);

        return cal.getTime();
    }
215978
public TimerType<T> start(java.util.Date start)
   {
      if (start != null)
      {
         childNode.getOrCreate("start").text(XMLDate.toXMLFormat(start));
         return this;
      }
      return null;
   }
613212
public Date getStart()
   {
      Date result = null;
      for (ResourceAssignment assignment : m_assignments)
      {
         if (result == null || DateHelper.compare(result, assignment.getStart()) > 0)
         {
            result = assignment.getStart();
         }
      }
      return (result);
   }
1142784
public static long getDayDifference(Date startDate, Date endDate) {
		long startTime = startDate.getTime();
		long endTime = endDate.getTime();
		long diffTime = endTime - startTime;
		long diffDays = TimeUnit.MILLISECONDS.toDays(diffTime);
		return diffDays;
	}
1122287
public static Date addDays(Date d, int days) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(d);
        cal.add(Calendar.DAY_OF_YEAR, days);
        return cal.getTime();
    }