Package com.pixelmed.utils

# Class DateUtilities

java.lang.Object
com.pixelmed.utils.DateUtilities

public class DateUtilities extends Object

Various static methods helpful for handling dates.

## Field Summary

Fields
Modifier and Type
Field
Description
`static DecimalFormat`
`threeDigitZeroPaddedFormat`
`static SimpleDateFormat`
`yyyymmddFormat`

## Method Summary

Modifier and Type
Method
Description
`static String`
`getAgeBetweenAsDICOMAgeString(String earlierDate, String laterDate)`
Get a DICOM Age String (AS) VR form age between two dates.
`static String`
`getAgeBetweenAsDICOMAgeString(Calendar earlierDate, Calendar laterDate)`
Get a DICOM Age String (AS) VR form age between two dates.
`static String`
`getAgeBetweenAsDICOMAgeString(Date earlierDate, Date laterDate)`
Get a DICOM Age String (AS) VR form age between two dates.

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### yyyymmddFormat

public static SimpleDateFormat yyyymmddFormat

### threeDigitZeroPaddedFormat

public static DecimalFormat threeDigitZeroPaddedFormat

## Method Details

### getAgeBetweenAsDICOMAgeString

public static String getAgeBetweenAsDICOMAgeString(String earlierDate, String laterDate) throws ParseException, IllegalArgumentException

Get a DICOM Age String (AS) VR form age between two dates.

Uses UK (not US) convention for leap year birthdays (earlierDate).

Parameters:
  `earlierDate` - for example, the date of birth
  `laterDate` - for example, the current date
Throws:
  `ParseException` - if one of the dates is not in the correct form
  `IllegalArgumentException` - if the later date is earlier than the earlier date

### getAgeBetweenAsDICOMAgeString

public static String getAgeBetweenAsDICOMAgeString(Date earlierDate, Date laterDate) throws IllegalArgumentException

Get a DICOM Age String (AS) VR form age between two dates.

Uses UK (not US) convention for leap year birthdays (earlierDate).

Parameters:
  `earlierDate` - for example, the date of birth
  `laterDate` - for example, the current date
Throws:
  `IllegalArgumentException` - if the later date is earlier than the earlier date

### getAgeBetweenAsDICOMAgeString

public static String getAgeBetweenAsDICOMAgeString(Calendar earlierDate, Calendar laterDate) throws IllegalArgumentException

Get a DICOM Age String (AS) VR form age between two dates.

Uses UK (not US) convention for leap year birthdays (earlierDate).

Parameters:
  `earlierDate` - for example, the date of birth
  `laterDate` - for example, the current date
Throws:
  `IllegalArgumentException` - if the later date is earlier than the earlier date