# 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

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`DateParser.InvalidDateException`

## Constructor Summary

Constructors
Constructor
Description
`DateParser()`

## Method Summary

Modifier and Type
Method
Description
`static String`
`getIsoDate(Date date)`
Generate a ISO 8601 date
`static Date`
`parse(String isodate)`
Parse the given string in ISO 8601 format and build a Date object.

### Methods inherited from class Object

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

## 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