Builds a date-time value that represents the start of the given day (all
time components set to 0).
@param date the day
@return the date-time value
506156
public static DateTimeValue dayStart(DateValue date) {
		return new DateTimeValueImpl(date.year(), date.month(), date.day(), 0, 0, 0);
	}
89180
public Date getNextWorkStart(Date date)
   {
      Calendar cal = Calendar.getInstance();
      cal.setTime(date);
      updateToNextWorkStart(cal);
      return cal.getTime();
   }
995956
public static String dateToString(Date date) {
        final TimeZone utc = TimeZone.getTimeZone("UTC");

        SimpleDateFormat tformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
        tformat.setTimeZone(utc);
        return tformat.format(date);
    }
478089
public static Calendar popCalendar(Date date)
   {
      Calendar calendar = popCalendar();
      calendar.setTime(date);
      return calendar;
   }
83708
public static Date fromJavaUtilDate(java.util.Date date) {
    Calendar cal = Calendar.getInstance();
    cal.setTime(date);
    cal.set(Calendar.HOUR_OF_DAY, 0);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.SECOND, 0);
    cal.set(Calendar.MILLISECOND, 0);
    // Calender.MONTH starts from 0 while G C date starts from 1
    return new Date(
        cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH));
  }
472285
public static int getDayOfWeek(Date date) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		return cal.get(Calendar.DAY_OF_WEEK);
	}
927158
public void setStartTime(final Date date) {

        if (!Objects.equals(m_model.getStart(), date)) {
            removeExceptionsOnChange(new Command() {

                public void execute() {

                    m_model.setStart(date);
                    setPatternDefaultValues(date);
                    valueChanged();
                }
            });
        }

    }
39520
public String getDateTime(Date date) {

        return CmsDateUtil.getDateTime(date, DateFormat.SHORT, m_locale);
    }
935474
public static java.util.Date toJavaUtilDate(Date date) {
    Calendar cal = Calendar.getInstance();
    cal.set(Calendar.HOUR_OF_DAY, 0);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.SECOND, 0);
    cal.set(Calendar.MILLISECOND, 0);
    // Calender.MONTH starts from 0 while G C date starts from 1
    cal.set(date.year, date.month - 1, date.dayOfMonth);
    return cal.getTime();
  }
1015643
public static DateTime of(Date date) {
		if (date instanceof DateTime) {
			return (DateTime) date;
		}
		return new DateTime(date);
	}
991985
public static java.sql.Time getSqlTime(java.util.Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return new java.sql.Time(cal.getTimeInMillis());
    }
1330360
public synchronized Date setStartDate(Date time)
    {
        m_cachedInfo.setStartDate(time);
        int iThisIndex = m_model.indexOf(this);
        if (iThisIndex != -1)
            m_model.fireTableRowsUpdated(iThisIndex, iThisIndex);
        this.changeRemoteDate(null, null, this, time, null);
        return this.getStartDate();
    }
10501
public void setDate(Date date) {
        DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
        df.setTimeZone(TimeZone.getTimeZone("GMT"));
        setDate(df.format(date));
    }
1169114
public static int getDayOfWeek(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.DAY_OF_WEEK);
    }
175494
public static Date getDayDate(Date date) {
		Calendar calendar = getCalendar();
		calendar.setTime(date);
		return getDayDate(calendar);
	}
474692
public static int getHour(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.HOUR_OF_DAY);
    }
749950
public static Date beginOfWeek(@NotNull final Date date) {
		return DateUtils.truncate(DateUtil.subDays(date, DateUtil.getDayOfWeek(date) - 1), Calendar.DATE);
	}