Class PdsDateConverter

java.lang.Object
gov.nasa.pds.registry.common.util.date.PdsDateConverter

public class PdsDateConverter extends Object
Utility class to convert dates from different PDS formats to "ISO instant" format.
Author:
karpenko
  • 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

      public String toIsoInstantString(String fieldName, String value) throws Exception
      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