Class PdsDateConverter
java.lang.Object
gov.nasa.pds.registry.common.util.date.PdsDateConverter
Utility class to convert dates from different PDS formats
to "ISO instant" format.
- Author:
- karpenko
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoIsoInstantString(String fieldName, String value) Convert a date in one of PDS date formats to ISO instant string.
-
Constructor Details
-
PdsDateConverter
public PdsDateConverter(boolean strict) Constructor- Parameters:
strict- if true, throw exception if a date could not be converted to ISO instant. If false, only print warning message.
-
-
Method Details
-
toIsoInstantString
Convert a date in one of PDS date formats to ISO instant string.- Parameters:
fieldName- Metadata field name. Field name is used to return default values for "start" and "stop" dates (e.g., mission "start_date_time" and "stop_date_time").value- a date in one of PDS date formats- Returns:
- ISO instant string
- Throws:
Exception- Generic exception
-