Class DateParser

java.lang.Object
htsjdk.samtools.util.DateParser

public class DateParser extends Object
NOTE: This code has been taken from w3.org, and modified slightly to handle timezones of the form [-+]DDDD, and also to fix a bug in the application of time zone to the parsed date. Date parser for ISO 8601 format http://www.w3.org/TR/1998/NOTE-datetime-19980827
  • Constructor Details

    • DateParser

      public DateParser()
  • Method Details

    • parse

      public static Date parse(String isodate) throws DateParser.InvalidDateException
      Parse the given string in ISO 8601 format and build a Date object.
      Parameters:
      isodate - the date in ISO 8601 format
      Returns:
      a Date instance
      Throws:
      DateParser.InvalidDateException - if the date is not valid
    • getIsoDate

      public static String getIsoDate(Date date)
      Generate a ISO 8601 date
      Parameters:
      date - a Date instance
      Returns:
      a string representing the date in the ISO 8601 format