Here you can find the source of formatToOpenMrsDate(Date date)
Parameter | Description |
---|---|
date | the date to be parsed |
public static String formatToOpenMrsDate(Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/*from ww w. ja va 2 s.c o m*/ * Parses the given {@link Date} to the {@link String} representation of that date in the format used by the OpenMRS. * * @param date the date to be parsed * @return the string representation of the given date */ public static String formatToOpenMrsDate(Date date) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); return dateFormat.format(date.getTime()); } }