Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## be.ehealth.technicalconnector.utils
Class DateUtils

    java.lang.Object
      be.ehealth.technicalconnector.utils.DateUtils

    public final class DateUtils

extends Object

Utility class to work with dates

Method Summary
`static org.joda.time.DateTime` | `convert(Calendar cal)` Converts an java.util.Calendar to an org.joda.DateTime
`static org.joda.time.DateTime` | `convert(Date date)` Converts an java.util.Date to an org.joda.DateTime
`static org.joda.time.DateTime` | `parseDate(String lexicalXSDDate)` Parses a date from the given lexicalXSDDate, returning a new DateTime.
`static org.joda.time.DateTime` | `parseDateTime(String lexicalXSDDate)` Parses a datetime from the given lexicalXSDDate, returning a new DateTime.
`static org.joda.time.DateTime` | `parseTime(String lexicalXSDDate)` Parses a time from the given lexicalXSDDate, returning a new DateTime.
`static String` | `printDate(org.joda.time.DateTime dateTime)` Parses the dateTime, returning a string.
`static String` | `printDateTime(org.joda.time.DateTime dateTime)` Combines the date and time by using the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZZ
`static String` | `printDateWithoutTimeZone(org.joda.time.DateTime dateTime)` Parses the dateTime, returning a string without timezone.
`static String` | `printTime(org.joda.time.DateTime dateTime)` Gives the time by using the following format: HH:mm:ss.SSSZZ

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### parseDateTime

    public static org.joda.time.DateTime parseDateTime(String lexicalXSDDate)

  Parses a datetime from the given lexicalXSDDate, returning a new DateTime. (ISO8601 standard)

  The parse will use the zone and chronology specified on this formatter.

  If the lexicalXSDDate contains a time zone string then that will be taken into account in adjusting the time of day as follows. The the resulting DateTime will have the zone of this formatter, but the parsed zone may have caused the time to be adjusted.

       datetime          = time | date-opt-time
       time              = 'T' time-element [offset]
       date-opt-time     = date-element ['T' [time-element] [offset]]
       date-element      = std-date-element | ord-date-element | week-date-element
       std-date-element  = yyyy ['-' MM ['-' dd]]
       ord-date-element  = yyyy ['-' DDD]
       week-date-element = xxxx '-W' ww ['-' e]
       time-element      = HH [minute-element] | [fraction]
       minute-element    = ':' mm [second-element] | [fraction]
       second-element    = ':' ss [fraction]
       fraction          = ('.' | ',') digit+
       offset            = 'Z' | (('+' | '-') HH [':' mm [':' ss [('.' | ',') SSS]]])

  for example: 2012-10-15T05:38:14.030+02:00

  Parameters:
    `lexicalXSDDate` -
  Returns:
    the new DateTime

### printDateTime

    public static String printDateTime(org.joda.time.DateTime dateTime)

  Combines the date and time by using the following format: yyyy-MM-dd'T'HH:mm:ss.SSSZZ

  Parameters:
    `dateTime` -
  Returns:
    the string value

### parseTime

    public static org.joda.time.DateTime parseTime(String lexicalXSDDate)

  Parses a time from the given lexicalXSDDate, returning a new DateTime. (ISO8601 standard)

  The parse will use the zone and chronology specified on this formatter.

  If the lexicalXSDDate contains a time zone string then that will be taken into account in adjusting the time of day as follows. The the resulting DateTime will have the zone of this formatter, but the parsed zone may have caused the time to be adjusted.

       time           = ['T'] time-element [offset]
       time-element   = HH [minute-element] | [fraction]
       minute-element = ':' mm [second-element] | [fraction]
       second-element = ':' ss [fraction]
       fraction       = ('.' | ',') digit+
       offset         = 'Z' | (('+' | '-') HH [':' mm [':' ss [('.' | ',') SSS]]])

  Parameters:
    `lexicalXSDDate` -
  Returns:
    the new DateTime

### printTime

    public static String printTime(org.joda.time.DateTime dateTime)

  Gives the time by using the following format: HH:mm:ss.SSSZZ

  Parameters:
    `dateTime` -
  Returns:
    the string value

### parseDate

    public static org.joda.time.DateTime parseDate(String lexicalXSDDate)

  Parses a date from the given lexicalXSDDate, returning a new DateTime. (ISO8601 standard)

  The parse will use the zone and chronology specified on this formatter.

  If the lexicalXSDDate contains a time zone string then that will be taken into account in adjusting the time of day as follows. The the resulting DateTime will have the zone of this formatter, but the parsed zone may have caused the time to be adjusted.

  Parameters:
    `lexicalXSDDate` -
  Returns:
    the new DateTime

### printDate

    public static String printDate(org.joda.time.DateTime dateTime)

  Parses the dateTime, returning a string. (ISO8601 standard)

  The parse will use the zone and chronology specified on this formatter.

  Parameters:
    `dateTime` -
  Returns:
    the string value

### printDateWithoutTimeZone

    public static String printDateWithoutTimeZone(org.joda.time.DateTime dateTime)

  Parses the dateTime, returning a string without timezone. (ISO8601 standard)

  The resulting format is yyyy-MM-dd

  Parameters:
    `dateTime` -
  Returns:
    the string value

### convert

    public static org.joda.time.DateTime convert(Calendar cal)

  Converts an java.util.Calendar to an org.joda.DateTime

  Parameters:
    `cal` -
  Returns:
    the new DateTime

### convert

    public static org.joda.time.DateTime convert(Date date)

  Converts an java.util.Date to an org.joda.DateTime

  Parameters:
    `date` - the date
  Returns:
    the DateTime

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Connector Packaging PERSNURSE 3.16.1 API
Copyright © {inceptionYear}-2018 eHealth. All Rights Reserved.