Package com.pixelmed.utils
Class DateUtilities
- java.lang.Object
-
- com.pixelmed.utils.DateUtilities
-
public class DateUtilities extends java.lang.Object
Various static methods helpful for handling dates.
-
-
Field Summary
Fields Modifier and Type Field Description static java.text.DecimalFormat
threeDigitZeroPaddedFormat
static java.text.SimpleDateFormat
yyyymmddFormat
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getAgeBetweenAsDICOMAgeString(java.lang.String earlierDate, java.lang.String laterDate)
Get a DICOM Age String (AS) VR form age between two dates.static java.lang.String
getAgeBetweenAsDICOMAgeString(java.util.Calendar earlierDate, java.util.Calendar laterDate)
Get a DICOM Age String (AS) VR form age between two dates.static java.lang.String
getAgeBetweenAsDICOMAgeString(java.util.Date earlierDate, java.util.Date laterDate)
Get a DICOM Age String (AS) VR form age between two dates.
-
-
-
Method Detail
-
getAgeBetweenAsDICOMAgeString
public static java.lang.String getAgeBetweenAsDICOMAgeString(java.lang.String earlierDate, java.lang.String laterDate) throws java.text.ParseException, java.lang.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 birthlaterDate
- for example, the current date- Throws:
java.text.ParseException
- if one of the dates is not in the correct formjava.lang.IllegalArgumentException
- if the later date is earlier than the earlier date
-
getAgeBetweenAsDICOMAgeString
public static java.lang.String getAgeBetweenAsDICOMAgeString(java.util.Date earlierDate, java.util.Date laterDate) throws java.lang.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 birthlaterDate
- for example, the current date- Throws:
java.lang.IllegalArgumentException
- if the later date is earlier than the earlier date
-
getAgeBetweenAsDICOMAgeString
public static java.lang.String getAgeBetweenAsDICOMAgeString(java.util.Calendar earlierDate, java.util.Calendar laterDate) throws java.lang.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 birthlaterDate
- for example, the current date- Throws:
java.lang.IllegalArgumentException
- if the later date is earlier than the earlier date
-
-