格式yyyy-MM-dd

@param dateString 标准形式的日期字符串
@return 日期对象
516003
public static DateTime parseDate(String dateString) {
		dateString = normalize(dateString);
		return parse(dateString, DatePattern.NORM_DATE_FORMAT);
	}
556375
private static String tempDateStringForJodaTime(String dateString) {
        final String fromPrefix = "292278994-";
        final String toPrefix   = "292278993-";
        return dateString.startsWith(fromPrefix)
             ? toPrefix + dateString.substring(fromPrefix.length())
             : dateString;
    }
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);
    }
128563
static Date parseDate(String dateString) {
    try {
      return DATE_FORMAT.parseDateTime(dateString).toDate();
    } catch (IllegalArgumentException e) {
      return null;
    }
  }
140176
public static Date string2DateISO(String st) {
        try {
            return new SimpleDateFormat("yyyy-MM-dd").parse(st);
        } catch (ParseException e) {
            throw new InvalidArgumentException(st);
        }
    }
1116731
private String getDateString(Date value)
   {
      Calendar cal = DateHelper.popCalendar(value);
      int year = cal.get(Calendar.YEAR);
      int month = cal.get(Calendar.MONTH) + 1;
      int day = cal.get(Calendar.DAY_OF_MONTH);
      DateHelper.pushCalendar(cal);
      
      StringBuilder sb = new StringBuilder(8);
      sb.append(m_fourDigitFormat.format(year));
      sb.append(m_twoDigitFormat.format(month));
      sb.append(m_twoDigitFormat.format(day));

      return (sb.toString());
   }
479734
public static Date strToDate(String date) throws ParseException {

        java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyyMMdd");

        java.util.Date d = sdf.parse(date);

        return d;
    }
243428
public static Date strToDate(String dateStr, String format) throws ParseException {
        return new SimpleDateFormat(format).parse(dateStr);
    }
839815
public static String convertDateToDateString(Date date) {
		if (date == null) {
			return null;
		} else {
			// DateFormat df = new SimpleDateFormat("yyyy-MM-dd'Z'");
			DateTimeFormatter df = FORMATTER_DATE_Z;
			return df.print(date.getTime());
		}
	}
1120882
protected Date parseDate(final String dateString) {
		Date date = null;
		if (dateString != null) {
			try {
				final SimpleDateFormat dateFormat = new SimpleDateFormat(FREESOUND_DATE_FORMAT);
				dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));

				date = dateFormat.parse(dateString);
			} catch (final ParseException e) {
				// TODO Log a warning
			}
		}

		return date;
	}
827279
public static Date stringToDate(String dateString) {
        if (!"".equals(dateString) && dateString != null) {
            // ISO_DATE_FORMAT = "yyyyMMdd";
            if (dateString.trim().length() == 8) {
                return stringToDate(dateString, ISO_DATE_FORMAT, LENIENT_DATE);
            } else if (dateString.trim().length() == 10) {
                // ISO_EXPANDED_DATE_FORMAT = "yyyy-MM-dd";
                return stringToDate(dateString, ISO_EXPANDED_DATE_FORMAT,
                        LENIENT_DATE);
            } else if (dateString.trim().length() == 19) {
                // DATETIME_PATTERN = "yyyy-MM-dd hh:mm:ss";
                return stringToDate(dateString, DATETIME_PATTERN, LENIENT_DATE);
            } else if (dateString.trim().length() == 11) {
                // CHINESE_EXPANDED_DATE_FORMAT = "yyyy年MM月dd日";
                return stringToDate(dateString, CHINESE_EXPANDED_DATE_FORMAT,
                        LENIENT_DATE);
            }
        }
        return null;
    }
104826
public static String getDateTimeStr(Date d) {
        if (d == null)
            return "";

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ");
        // 20140315 test will problem +0000
        return sdf.format(d);
    }
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;
	}
448903
public String dateToStringDateFormat(Date date)
   {
       if (date == null)
           return null;
       return gDateFormat.format(date);
   }
727412
public static Date parseIso8601Date(String dateString) {
        try {
            return DateUtils.iso8601DateFormat.parseDateTime(dateString).toDate();
        } catch (IllegalArgumentException e) {
            // If the first ISO 8601 parser didn't work, try the alternate
            // version which doesn't include fractional seconds
            return DateUtils.alternateIso8601DateFormat.parseDateTime(dateString).toDate();
        }
    }
611327
public static Date formatStringToDate(String argDateStr, String argFormat) throws Exception {
        if (argDateStr == null || argDateStr.trim().length() < 1) {
            throw new Exception("参数[日期]不能为空!");
        }
        String strFormat = argFormat;
        if (strFormat == null || strFormat.length() == 0) {
            strFormat = Y_M_D;
            if (argDateStr.length() > 16) {
                strFormat = Y_M_D_HMS;
            } else if (argDateStr.length() > 10) {
                strFormat = Y_M_D_HM;
            }
        }
        SimpleDateFormat sdfFormat = new SimpleDateFormat(strFormat);
        //严格模式
        sdfFormat.setLenient(false);
        try {
            return sdfFormat.parse(argDateStr);
        } catch (ParseException e) {
            throw new Exception(e);
        }
    }
615354
@Deprecated
	public static String getDateStringMMDDYYYY(Date date) {
		if(date==null) return "";
		Calendar C=Calendar.getInstance();
		C.setTime(date);
		int day=C.get(Calendar.DATE);
		int month=C.get(Calendar.MONTH)+1;
		return
			(month>=0 && month<=9 ? "0":"")
			+month
			+(day>=0 && day<=9 ? "0":"")
			+day
			+C.get(Calendar.YEAR)
		;
	}