修改日期为某个时间字段四舍五入时间

@param date {@link Date}
@param dateField 时间字段
@return {@link DateTime}
@since 4.5.7
964729
public static DateTime round(Date date, DateField dateField) {
		return new DateTime(round(calendar(date), dateField));
	}
343664
public String getDate(Date date) {

        return CmsDateUtil.getDate(date, DateFormat.SHORT, m_locale);
    }
448028
public static DateTime truncate(Date date, DateField dateField) {
		return new DateTime(truncate(calendar(date), dateField));
	}
305058
public String stringValue(Date date) {
		String value = null;
		if (date != null) {
			SimpleDateFormat sdf = formatters.get(0);
			synchronized (sdf) {
				value = sdf.format(date);
			}
		}
		return value;
	}
907739
public String dateToString(Date date)
    {
        if (date == null)
            return "";
        try {
            return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.LONG).format(date);
        } catch (Exception ex) {
        }
        return "";
    }
175494
public static Date getDayDate(Date date) {
		Calendar calendar = getCalendar();
		calendar.setTime(date);
		return getDayDate(calendar);
	}
161667
public String getDateTime(Date date) {

        return CmsDateTimeUtil.getDateTime(date, CmsDateTimeUtil.Format.SHORT);
    }
736277
public final String format(Date date)
    {
        return format(date, new StringBuffer(),
                      DontCareFieldPosition.INSTANCE).toString();
    }
133313
public static Calendar getCalendarInstance(final Date date) {
        Calendar instance;
        if (date instanceof DateTime) {
            final DateTime dateTime = (DateTime) date;
            if (dateTime.getTimeZone() != null) {
                instance = Calendar.getInstance(dateTime.getTimeZone());
            }
            else if (dateTime.isUtc()) {
                instance = Calendar.getInstance(TimeZones.getUtcTimeZone());
            }
            else {
            	// a date-time without a timezone but not UTC is floating
                instance = Calendar.getInstance();
            }
        }
        else {
            instance = Calendar.getInstance(TimeZones.getDateTimeZone());
        }
        return instance;
    }
1304461
public static Dater of(Date date, DateStyle dateStyle) {
		return of(date).with(dateStyle);
	}
993517
public static DateTime offset(Date date, DateField dateField, int offset) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.add(dateField.getValue(), offset);
		return new DateTime(cal.getTime());
	}
1297225
public static String dateToString(Date date) {
        GregorianCalendar c = new GregorianCalendar(GMT);
        c.setTime(date);
        String s = calendarToString(c);
        assert s.endsWith("+00:00");
        return s.substring(0, s.length() - 6) + "-00:00";
    }
1207162
public static String formatTime(Date date) {
		if (null == date) {
			return null;
		}
		return DatePattern.NORM_TIME_FORMAT.format(date);
	}
448903
public String dateToStringDateFormat(Date date)
   {
       if (date == null)
           return null;
       return gDateFormat.format(date);
   }
284686
public static String getDateString(String format, Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
1255725
public static java.util.Date toDate(String date, String time) {
		if (date == null || time == null)
			return null;
		String month;
		String day;
		String year;
		String hour;
		String minute;
		String second;

		int dateSlash1 = date.indexOf("/");
		int dateSlash2 = date.lastIndexOf("/");

		if (dateSlash1 <= 0 || dateSlash1 == dateSlash2)
			return null;
		int timeColon1 = time.indexOf(":");
		int timeColon2 = time.lastIndexOf(":");

		if (timeColon1 <= 0)
			return null;
		month = date.substring(0, dateSlash1);
		day = date.substring(dateSlash1 + 1, dateSlash2);
		year = date.substring(dateSlash2 + 1);
		hour = time.substring(0, timeColon1);

		if (timeColon1 == timeColon2) {
			minute = time.substring(timeColon1 + 1);
			second = "0";
		} else {
			minute = time.substring(timeColon1 + 1, timeColon2);
			second = time.substring(timeColon2 + 1);
		}

		return toDate(month, day, year, hour, minute, second);
	}
1357796
public static final synchronized Date parseDate(String date) {
		try {
			return dateFormat.parse(date);
		} catch(ParseException e) {
			throw new RuntimeException(e);
		}
	}