Java Parse Date Pattern YYYY parseOpenMrsDate(String date)

Here you can find the source of parseOpenMrsDate(String date)

Description

Parses the given string in date format used by OpenMRS to an instance of the Date class.

License

Open Source License

Parameter

Parameter Description
date the string representation of the date

Exception

Parameter Description
ParseException if there were problems while parsing the given string

Return

the date parsed from the string

Declaration

public static Date parseOpenMrsDate(String date) throws ParseException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    /**//from w  w  w  .  ja  v  a  2s.co m
     * Parses the given string in date format used by OpenMRS to an instance of the {@link Date} class.
     *
     * @param date  the string representation of the date
     * @return the date parsed from the string
     * @throws ParseException if there were problems while parsing the given string
     */
    public static Date parseOpenMrsDate(String date) throws ParseException {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
        return dateFormat.parse(date);
    }
}

Related

  1. parseMysql(String s)
  2. parseMysqlDate(String dateStr)
  3. parseMySQLDateString(String s)
  4. parseMySQLDateTime(String date)
  5. parseNanos(final String date)
  6. parseOpenMrsDate(String date)
  7. parsePurgeDateString(String str)
  8. parser(String strDate, String formatter)
  9. parserDate(String str)