Java Hour Format formatToOpenMrsDate(Date date)

Here you can find the source of formatToOpenMrsDate(Date date)

Description

Parses the given Date to the String representation of that date in the format used by the OpenMRS.

License

Open Source License

Parameter

Parameter Description
date the date to be parsed

Return

the string representation of the given date

Declaration

public static String formatToOpenMrsDate(Date date) 

Method Source Code

//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());
    }
}

Related

  1. formatTime(String dateTimeString)
  2. formatTime_(String time)
  3. formatTime_1(long time_value)
  4. formatTime_2(long time_value, long frame_rate)
  5. formatToHour(Date date)
  6. formatToSec(Date date)
  7. formatToString(Date date)
  8. formatUIDate(Calendar calendar)
  9. formatUnixFileListing(final Date d)