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

DateparseInsituFileNameDateFormat(String timeString)
parse Insitu File Name Date Format
return INSITU_FILE_NAME_DATE_FORMAT.parse(timeString);
StringparseLastModifDate(final File file)
Parse date with pattern yyyyMMddHHmm.
Date date = new Date(file.lastModified());
DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmm");
return dateFormat.format(date);
DateparseLogstashDate(final String date_string)
Parses logstash specific format into a date object, logstash dates look like: 2016-03-24T09:38:03.770000-0400
return formatter.parse(date_string);
Dateparsemm(String dateStr)
yyyy-MM-dd HH:mm
return YYYY_MM_DD_HH_MM_FORMAT.get().parse(dateStr);
DateparseMysql(String s)
parse Mysql
try {
    DateFormat fmtTemp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    return fmtTemp.parse(s);
} catch (ParseException e) {
    return null;
DateparseMysqlDate(String dateStr)
Parses a string value into a date vale
try {
    return mysqlDateTimeFormat.parse(dateStr);
} catch (ParseException e) {
    try {
        return mysqlDateFormat.parse(dateStr);
    } catch (ParseException e1) {
        throw new RuntimeException(e);
DateparseMySQLDateString(String s)

Converts string to a date

return parseDateString(s, "yyyy-MM-dd");
DateparseMySQLDateTime(String date)
parse My SQL Date Time
try {
    return mySQLDateTimeFormat.parse(date);
} catch (ParseException e) {
    e.printStackTrace();
return null;
longparseNanos(final String date)
parse Nanos
switch (date.length()) {
case 8: { 
    synchronized (D8) {
        return MM * D8.parse(date).getTime();
case 9: { 
    synchronized (D9) {
...
DateparseOpenMrsDate(String date)
Parses the given string in date format used by OpenMRS to an instance of the Date class.
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
return dateFormat.parse(date);