public final class DateConverter
extends java.lang.Object
This is (and will not be) a Java date parsing library and will likely still have limited support for various strings as it’s main use case it to parse from PDF date strings.
Modifier and Type | Field and Description |
---|---|
private static java.text.SimpleDateFormat[] |
POTENTIAL_FORMATS |
Modifier | Constructor and Description |
---|---|
private |
DateConverter()
According to check-style, Utility classes should not have a public or default constructor.
|
Modifier and Type | Method and Description |
---|---|
private static java.util.Calendar |
fromISO8601(java.lang.String dateString)
Get a Calendar from an ISO8601 date string.
|
static java.util.Calendar |
toCalendar(java.lang.String date)
This will convert a string to a calendar.
|
static java.lang.String |
toISO8601(java.util.Calendar cal)
Convert the date to iso 8601 string format.
|
static java.lang.String |
toISO8601(java.util.Calendar cal,
boolean printMillis)
Convert the date to iso 8601 string format.
|
private static void |
updateZoneId(java.util.TimeZone tz)
Update the zone ID based on the raw offset.
|
private DateConverter()
public static java.util.Calendar toCalendar(java.lang.String date) throws java.io.IOException
date
- The string representation of the calendar.java.io.IOException
- If the date string is not in the correct format.private static void updateZoneId(java.util.TimeZone tz)
tz
- the time zone to update.public static java.lang.String toISO8601(java.util.Calendar cal)
cal
- The date to convert.public static java.lang.String toISO8601(java.util.Calendar cal, boolean printMillis)
cal
- The date to convert.printMillis
- Print Milliseconds.private static java.util.Calendar fromISO8601(java.lang.String dateString)
dateString
-