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

DateparseStringToDate(String date)
parse String To Date
Date result = null;
String parse = date;
parse = parse.replaceFirst("^[0-9]{4}([^0-9])", "yyyy$1");
parse = parse.replaceFirst("^[0-9]{2}([^0-9])", "yy$1");
parse = parse.replaceFirst("([^0-9])[0-9]{1,2}([^0-9])", "$1MM$2");
parse = parse.replaceFirst("([^0-9])[0-9]{1,2}( ?)", "$1dd$2");
parse = parse.replaceFirst("( )[0-9]{1,2}([^0-9])", "$1HH$2");
parse = parse.replaceFirst("([^0-9])[0-9]{1,2}([^0-9])", "$1mm$2");
...
java.util.DateparseStringToDate(String dateString)
parse String To Date
java.text.SimpleDateFormat dfparser;
dateString = dateString.replaceAll("th", "");
dateString = dateString.replaceAll("nd", "");
dateString = dateString.replaceAll("\\n", " ");
dateString = dateString.replaceAll("\\r", " ");
dateString = dateString.replaceAll(System.getProperty("line.separator"), " ");
dateString = dateString.replaceAll("\\s{2,}", " ");
try {
...
StringparseStringToDatePrettyPrint(Date date)
Converts a Date object into a String object for pretty printing.
return pretty_format.format(date);
java.util.DateparseStringToUtilDate(String strDate)
parse String To Util Date
java.util.Date date = null;
try {
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
    date = df.parse(strDate);
} catch (Exception ex) {
    ex.printStackTrace();
return date;
...
DateparseTIPPDate(String dateString)
parse TIPP Date
try {
    SimpleDateFormat df = new SimpleDateFormat(FORMAT);
    return df.parse(dateString);
} catch (ParseException e) {
    throw new IllegalArgumentException("Invalid date string: " + dateString);
DateparseToDate(final String date, final String format)
Parses the String date to a date object.
final DateFormat df = new SimpleDateFormat(format);
Date parsedDate = null;
parsedDate = df.parse(date);
return parsedDate;
DateparseToDate(String date)
parse To Date
Date parsedDate = null;
try {
    parsedDate = shortDateFormat.parse(date);
} catch (Exception e) {
return parsedDate;
DateparseToDate(String date, String format)
parse To Date
if (date == null)
    return null;
Date dDate = null;
if (format != null) {
    DateFormat formater = new SimpleDateFormat(format);
    dDate = formater.parse(date);
} else {
    DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
...
DateparseToDateLenient(final String date, final String format, final boolean lenient)
Parses the String date to a date object.
if (date == null || format == null || format.length() <= 0) {
    return null;
final DateFormat df = new SimpleDateFormat(format);
df.setLenient(lenient);
Date parsedDate = null;
try {
    parsedDate = df.parse(date);
...
GregorianCalendarparseToGregorianCalendar(String dateString)
parse To Gregorian Calendar
DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_STRING);
GregorianCalendar calendar = new GregorianCalendar(TimeZone.getTimeZone(GMT_TIMEZONE));
calendar.setTime(dateFormat.parse(dateString));
return calendar;