Here you can find the source of parseOpenMrsDate(String date)
Parameter | Description |
---|---|
date | the string representation of the date |
Parameter | Description |
---|---|
ParseException | if there were problems while parsing the given string |
public static Date parseOpenMrsDate(String date) throws ParseException
//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); } }