org.openhealthexchange.openpixpdq.util
Class DateUtil

java.lang.Object
  extended by org.openhealthexchange.openpixpdq.util.DateUtil

public class DateUtil
extends java.lang.Object

This class contains utility methods for date

Version:
Dec 01, 2008
Author:
Rasakannu Palaniyandi

Constructor Summary
DateUtil()
           
 
Method Summary
static java.util.Date convertHL7Date(java.lang.String fromDate)
          Converts the date String into date format
static java.util.Calendar convertHL7DateToCalender(java.lang.String fromDate)
          Converts the date String into Calender
static java.lang.String formatDateTime(java.util.Date date)
          Formats a date/time according to the HL7 v2.3.1 spec.
static java.lang.String formatDateTime(java.util.Date date, java.lang.String formatString)
          Formats a date/time according to the HL7 v2.3.1 spec unless a custom format string is supplied, then use that.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateUtil

public DateUtil()
Method Detail

convertHL7DateToCalender

public static java.util.Calendar convertHL7DateToCalender(java.lang.String fromDate)
Converts the date String into Calender

Parameters:
fromDate - as String to be converted from
Returns:
Calender

convertHL7Date

public static java.util.Date convertHL7Date(java.lang.String fromDate)
Converts the date String into date format

Parameters:
fromDate - as String to be converted from
Returns:
Date

formatDateTime

public static java.lang.String formatDateTime(java.util.Date date,
                                              java.lang.String formatString)
Formats a date/time according to the HL7 v2.3.1 spec unless a custom format string is supplied, then use that.

Parameters:
date - the date/time to format
formatString - a custom format string, or NULL for the default
Returns:
the formatted data as a string

formatDateTime

public static java.lang.String formatDateTime(java.util.Date date)
Formats a date/time according to the HL7 v2.3.1 spec.

Parameters:
date - the date/time to format
Returns:
the formatted data/time as a string