转换为{@link java.sql.Date}

@param date {@link java.util.Date}
@return {@link java.sql.Date}
@since 3.1.2
15317
public static java.sql.Date toSqlDate(java.util.Date date) {
		return new java.sql.Date(date.getTime());
	}
798392
public String getDate(Date date) {

        return CmsDateTimeUtil.getDate(date, CmsDateTimeUtil.Format.SHORT);
    }
1036109
public static final Date toDateTime_(String date) {
		try {
			return FORMAT_DATE_TIME_.parse(date);
		} catch (ParseException e) {
			throw new KnifeUtilsException(e);
		}
	}
45384
public static Calendar getDateCeil(Date date) {
        Calendar cal = new GregorianCalendar();
        cal.setTime(date);
        return new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH));
    }
1146334
public static java.sql.Date convertDate(String date, Locale locale) {
        SimpleDateFormat df;
        java.util.Date dbDate = null;
        java.sql.Date sqldate = null;
        try {
            if (date == null || date.equals("")) {
                return null;
            }

            df = (SimpleDateFormat) DateFormat.getDateInstance(dateStyle, locale);

            SimpleDateFormat sdf = new SimpleDateFormat(df.toPattern());
            java.text.ParsePosition pos = new java.text.ParsePosition(0);
            sdf.setLenient(false);
            dbDate = sdf.parse(date, pos);
            return new java.sql.Date(dbDate.getTime());

        } catch (Exception e) {
            return null;
        }
    }
1293014
public static String toDateString(final Date date) {

        String result;
        if (date == null) {
            result = "";
        } else {
            result = Z_DATE_FORMAT.format(date);
        }
        return result;
    }
1077114
public static Date parseDate(String date, String pattern) {
        try {
            return org.apache.commons.lang.time.DateUtils.parseDate(date, new String[] {pattern});
        } catch (ParseException e) {
            return null;
        }
    }
85996
public static CharSequence getJSDate(Date date)
	{
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(date);

		return getJSDate(calendar);
	}
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);
	}
808878
public static Date getDateByPattern(String date)
    {
        if (StringUtils.isNumeric(date))
        {
            return new Date(Long.parseLong(date));
        }

        for (String p : patterns)
        {
            try
            {
                DateFormat formatter = new SimpleDateFormat(p);
                Date dt = formatter.parse(date);
                return dt;
            }
            catch (IllegalArgumentException iae)
            {
                // Do nothing.
                // move to next pattern.
            }
            catch (ParseException e)
            {
                // Do nothing.
                // move to next pattern.
            }

        }
        log.error("Required Date format is not supported!" + date);
        throw new PropertyAccessException("Required Date format is not supported!" + date);
    }
300162
public static String formatDate(Date date) {
        SimpleDateFormat formatter = new SimpleDateFormat(TIMESTAMP_FORMAT);
        return formatter.format(date);
    }
1093646
public static DateValue getInstance(Date date) {
        DateValue result;
        if (date != null) {
            synchronized (cache) {
                result = cache.get(date);
                if (result == null) {
                    result = new DateValue(date);
                    cache.put(date, result);
                }
            }
        } else {
            result = getInstance(new Date());
        }
        return result;
    }
532605
public static String format( Date date ) {
        return format( DateFormat.DATE_FORMAT_STR_ISO8601, DateFormat.UTC_TIMEZONE, date );
    }
1241293
public static Date[] getSeasonDate(Date date) {
        Date[] season = new Date[3];
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        int nSeason = getQuarter(date);
        if (nSeason == 1) {// 第一季度
            c.set(Calendar.MONTH, Calendar.JANUARY);
            season[0] = c.getTime();
            c.set(Calendar.MONTH, Calendar.FEBRUARY);
            season[1] = c.getTime();
            c.set(Calendar.MONTH, Calendar.MARCH);
            season[2] = c.getTime();
        } else if (nSeason == 2) {// 第二季度
            c.set(Calendar.MONTH, Calendar.APRIL);
            season[0] = c.getTime();
            c.set(Calendar.MONTH, Calendar.MAY);
            season[1] = c.getTime();
            c.set(Calendar.MONTH, Calendar.JUNE);
            season[2] = c.getTime();
        } else if (nSeason == 3) {// 第三季度
            c.set(Calendar.MONTH, Calendar.JULY);
            season[0] = c.getTime();
            c.set(Calendar.MONTH, Calendar.AUGUST);
            season[1] = c.getTime();
            c.set(Calendar.MONTH, Calendar.SEPTEMBER);
            season[2] = c.getTime();
        } else if (nSeason == 4) {// 第四季度
            c.set(Calendar.MONTH, Calendar.OCTOBER);
            season[0] = c.getTime();
            c.set(Calendar.MONTH, Calendar.NOVEMBER);
            season[1] = c.getTime();
            c.set(Calendar.MONTH, Calendar.DECEMBER);
            season[2] = c.getTime();
        }
        return season;
    }
559960
public static Date parseDate(String date) {
        if (date == null) {
            return null;
        }
        try {
            return org.apache.commons.lang.time.DateUtils.parseDate(date, new String[] {DSP_DEFAULT_TIME_FORMAT});
        } catch (ParseException e) {
            return null;
        }
    }
907739
public String dateToString(Date date)
    {
        if (date == null)
            return "";
        try {
            return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.LONG).format(date);
        } catch (Exception ex) {
        }
        return "";
    }
353178
public static Date parseDate(String date) throws JournalException {
        try {
            SimpleDateFormat parser = new SimpleDateFormat(TIMESTAMP_FORMAT);
            return parser.parse(date);
        } catch (ParseException e) {
            throw new JournalException(e);
        }
    }