Java Utililty Methods Parse Date Pattern YYYY

List of utility methods to do Parse Date Pattern YYYY

Description

The list of methods to do Parse Date Pattern YYYY are organized into topic(s).

Method

Tparse(Class clazz, Object object)
parse
T defaultValue = null;
try {
    if (clazz == Date.class) {
        String stringValue = parse(String.class, object);
        return clazz.cast(new SimpleDateFormat("EEE MMM d HH:mm:ss Z yyyy", Locale.US).parse(stringValue));
    if (clazz == Integer.class) {
        defaultValue = (T) DEFAULT_INTEGER;
...
Stringparse(Date d)
parse
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd");
String dateStr = sdf.format(d);
return dateStr;
Dateparse(Date strDate, String pattern)
parse
SimpleDateFormat df = new SimpleDateFormat(pattern);
try {
    return df.parse(df.format(strDate));
} catch (ParseException e) {
    e.printStackTrace();
return null;
Dateparse(final String dateString)

Parse the provided date.

return parse(dateString, null);
Dateparse(final String inputDate)
Parse Utc date string to date
final boolean isTruncatedDate = isTruncatedDate(inputDate);
for (final String format : INPUT_DATE_FORMATS) {
    try {
        return createDateFormat(format, isTruncatedDate).parse(inputDate);
    } catch (final ParseException e) {
throw new JsonParseException("Unsupported Date format " + inputDate);
...
Dateparse(final String s)
parse
try {
    return sdf1.parse(s);
} catch (ParseException e) {
return null;
Dateparse(final String source)
parse
if (source == null || source.trim().length() == 0) {
    return null;
if (source.length() <= dateTimeFormat.toPattern().length()
        && source.length() >= dateTimeFormat.toPattern().length() - 5) {
    try {
        return dateTimeFormat.parse(source);
    } catch (ParseException ex) {
...
java.util.Dateparse(final String source)
parse
return DATE_FORMAT.parse(source);
Dateparse(Long date)
parse
try {
    return DB_FORMAT.parse(String.valueOf(date));
} catch (ParseException e) {
    return null;
Dateparse(Long time)
parse
if (time == null) {
    return null;
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
return cal.getTime();