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

DateparseApplePurchaseDate(String dateStr)
Apple IAP receipt purchase date string format: "purchase-date-pst" = "2012-07-12 05:54:35 America/Los_Angeles";
try {
    Date date = SDF_APPLE.parse(dateStr);
    return date;
} catch (ParseException e) {
return null;
DateparseArgument(String textDate)
parse Argument
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
return df.parse(textDate, new ParsePosition(0));
DateTimeparseAscTime(String date)
Parses an ASC formatted date string into a DateTime object
DateTime dateTime = null;
try {
    Date parsedDate = getDateFormat(ASC_FORMAT).parse(date);
    dateTime = new DateTime(parsedDate.getTime()).withZone(DateTimeZone.forID("GMT"));
} catch (ParseException e) {
    dateTime = null;
return dateTime;
...
DateTimeparseAsDateTime(String date)
parse As Date Time
return new DateTime(parseDate(date));
DateparseAtomDate(String date_str)
parse Atom Date
final String[] formats = { "yyyy-MM-dd'T'kk:mm:ss'Z'", "yyyy-MM-dd'T'kk:mm:ssz", "yyyy-MM-dd'T'kk:mm:ssZ",
        "yyyy-MM-dd'T'kk:mm:ss" };
for (int i = 0; i < formats.length; i++) {
    try {
        SimpleDateFormat format = new SimpleDateFormat(formats[i], Locale.US);
        return (format.parse(date_str));
    } catch (ParseException e) {
return (null);
DateparseBingDate(String dateString)
parse Bing Date
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss'Z'");
df.setTimeZone(TimeZone.getTimeZone("GMT"));
return parseDateString(dateString, df);
CalendarparseBitcoin(String calendarString)
parse Bitcoin
try {
    Date date = bitcoinFormatter.parse(calendarString);
    Calendar cal = new GregorianCalendar();
    cal.setTime(date);
    return cal;
} catch (ParseException e) {
    e.printStackTrace();
return null;
StringparseCalendar2String(Calendar calendar)
parse Calendar String
return parseCalendar2String(calendar, null);
CalendarparseCalendarString(String dateTimeString)
Converts a dateTimeString and makes a Calendar object
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
Date date = null;
try {
    date = dateFormat.parse(dateTimeString);
} catch (ParseException e) {
    e.printStackTrace();
Calendar cal = Calendar.getInstance();
...
DateparseCDADateFormat(String xsdDate)
Marshall CDA date/time/zone format to java Date type.
Date jDate = null;
try {
    jDate = cdaDateTimeFormat.parse(xsdDate);
} catch (ParseException ex) {
    try {
        jDate = cdaDateTimeNoZoneFormat.parse(xsdDate);
    } catch (ParseException ex1) {
        try {
...