| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final BigDecimal | |
| private static final BigDecimal | |
| private static final BigDecimal | |
| private static final Pattern | date_ptrn1
The following patterns are used in |
| private static final Pattern | |
| private static final Pattern | |
| private static final Pattern | |
| private static final Pattern | |
| private static final Pattern | |
| private static final DateTimeFormatter | |
| public static final long | |
| public static final int | |
| private static final ThreadLocal | |
| private static final ThreadLocal | |
| private static final ThreadLocal | |
| public static final int | |
| public static final int | |
| public static final int | |
| private static final Pattern |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected static int | Returns: days number of days since 1900/12/31the Calendar cal, boolean use1904windowing)Given a Calendar, return the number of days since 1900/12/31. |
| protected static int | Returns: days number of days since 1900/12/31the Date date, boolean use1904windowing)Given a LocalDateTime, return the number of days since 1900/12/31. |
| private static int | Returns: days number of days since 1900/12/31the year year, int the day of the year dayOfYear, boolean use1904windowing)Given a year and day of year, return the number of days since 1900/12/31. |
| private static void | |
| public static double | Returns: a double between 0 and 1 representing the fraction of the dayConverts a string of format "HH:MM" or "HH:MM:SS" to its (Excel) numeric equivalent |
| private static double | |
| pack-priv static int | Returns: days number of days in years prior to yr.a year (1900 < yr < 4000) yr, boolean Should 1900 or 1904 date windowing be used? use1904windowing)Return the number of days in prior years since 1900 |
| private static Calendar | |
| public static double | Returns: Excel representation of Date (-1 if error - test for error by checking for less than 0.1)the Date date)Given a LocalDate, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. |
| public static double | Returns: Excel representation of Date (-1 if error - test for error by checking for less than 0.1)the Date date, boolean Should 1900 or 1904 date windowing be used? use1904windowing)Given a LocalDate, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. |
| public static double | Returns: Excel representation of Date (-1 if error - test for error by checking for less than 0.1)the Date date)Given a LocalDateTime, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. |
| public static double | Returns: Excel representation of Date (-1 if error - test for error by checking for less than 0.1)the Date date, boolean Should 1900 or 1904 date windowing be used? use1904windowing)Given a LocalDateTime, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. |
| public static double | Returns: Excel representation of Date (-1 if error - test for error by checking for less than 0.1)the Date date)Given a Date, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. |
| public static double | Returns: Excel representation of Date (-1 if error - test for error by checking for less than 0.1)the Date date, boolean Should 1900 or 1904 date windowing be used? use1904windowing)Given a Date, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. |
| public static double | Returns: Excel representation of Date (-1 if error - test for error by checking for less than 0.1)the Calendar holding the date to convert date, boolean Should 1900 or 1904 date windowing be used? use1904windowing)Given a Date in the form of a Calendar, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. |
| public static Calendar | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date)Get EXCEL date as Java Calendar (with default time zone). |
| public static Calendar | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date, boolean true if date uses 1904 windowing,
or false if using 1900 date windowing. use1904windowing)Get EXCEL date as Java Calendar (with default time zone). |
| public static Calendar | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date, boolean true if date uses 1904 windowing,
or false if using 1900 date windowing. use1904windowing, TimeZone The TimeZone to evaluate the date in timeZone)Get EXCEL date as Java Calendar with given time zone. |
| public static Calendar | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date, boolean true if date uses 1904 windowing,
or false if using 1900 date windowing. use1904windowing, TimeZone The TimeZone to evaluate the date in timeZone, boolean round to closest second roundSeconds)Get EXCEL date as Java Calendar with given time zone. |
| public static Calendar | Returns: Java representation of the date in UTC, or null if date is not a valid Excel dateThe Excel date. date, boolean true if date uses 1904 windowing,
or false if using 1900 date windowing. use1904windowing)Get EXCEL date as Java Calendar with UTC time zone. |
| public static Date | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date, TimeZone The TimeZone to evaluate the date in tz)Given an Excel date with using 1900 date windowing, and converts it to a java.util.Date. |
| public static Date | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date)Given an Excel date with using 1900 date windowing, and converts it to a java.util.Date. |
| public static Date | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date, boolean true if date uses 1904 windowing,
or false if using 1900 date windowing. use1904windowing, TimeZone The TimeZone to evaluate the date in tz)Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.util.Date. |
| public static Date | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date, boolean true if date uses 1904 windowing,
or false if using 1900 date windowing. use1904windowing, TimeZone The TimeZone to evaluate the date in tz, boolean round to closest second roundSeconds)Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.util.Date. |
| public static Date | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date, boolean true if date uses 1904 windowing,
or false if using 1900 date windowing. use1904windowing)Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.util.Date. |
| public static LocalDateTime | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date)Given an Excel date with using 1900 date windowing, and converts it to a java.time.LocalDateTime. |
| public static LocalDateTime | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date, boolean true if date uses 1904 windowing,
or false if using 1900 date windowing. use1904windowing)Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.time.LocalDateTime. |
| public static LocalDateTime | Returns: Java representation of the date, or null if date is not a valid Excel dateThe Excel date. date, boolean true if date uses 1904 windowing,
or false if using 1900 date windowing. use1904windowing, boolean round to closest second roundSeconds)Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.time.LocalDateTime. |
| private static double | internalGetExcelDate(int year, int dayOfYear, int hour, int minute, int second, int milliSecond, boolean use1904windowing)
|
| public static boolean | Returns: true if it is a valid date format, false if not or nullThe number format index and string expression, or null if not specified numFmt)Given a format ID and its format String, will check to see if the format represents a date format or not. |
| public static boolean | Returns: true if it is a valid date format, false if not or nullThe index of the format, eg from ExtendedFormatRecord.getFormatIndex formatIndex, String The format string, eg from FormatRecord.getFormatString formatString)Given a format ID and its format String, will check to see if the format represents a date format or not. |
| private static boolean | |
| public static boolean | Returns: true if it looks like a dateThe cell to look at cell)Check if a cell contains a date Since dates are stored internally in Excel as double values we infer it is a date if it is formatted as such. |
| public static boolean | Returns: true if it looks like a dateThe cell to look at cell, ConditionalFormattingEvaluator if available, or null cfEvaluator)Check if a cell contains a date Since dates are stored internally in Excel as double values we infer it is a date if it is formatted as such. |
| public static boolean | isCellInternalDateFormatted(Cell cell)
Check if a cell contains a date, checking only for internal excel date formats. |
| public static boolean | isInternalDateFormat(int format)
Given a format ID this will check whether the format represents an internal excel date format or not. |
| public static boolean | Returns: true if validthe double value value)Given a double, checks if it is a valid Excel date. |
| public static Double | |
| private static int | |
| private static int | |
| public static Date | Returns: a double representing the (integer) number of days since the start of the Excel epochConverts a string of format "YYYY/MM/DD" to its (Excel) numeric equivalent |
| private static Date | |
| public static void | setCalendar(Calendar calendar, int wholeDays, int millisecondsInDay, boolean use1904windowing, boolean roundSeconds)
|
| public static LocalDateTime | Returns: LocalDateTime instancethe date date)Convert a Java Date (at UTC) to LocalDateTime. |
| public static LocalDateTime | Returns: LocalDateTime instancethe date date)Convert a Java Calendar (at UTC) to LocalDateTime. |
| BAD_DATE | back to summary |
|---|---|
| private static final int BAD_DATE | |
| BD_MILISEC_RND | back to summary |
|---|---|
| private static final BigDecimal BD_MILISEC_RND | |
| BD_NANOSEC_DAY | back to summary |
|---|---|
| private static final BigDecimal BD_NANOSEC_DAY | |
| BD_SECOND_RND | back to summary |
|---|---|
| private static final BigDecimal BD_SECOND_RND | |
| date_ptrn1 | back to summary |
|---|---|
| private static final Pattern date_ptrn1 The following patterns are used in | |
| date_ptrn2 | back to summary |
|---|---|
| private static final Pattern date_ptrn2 | |
| date_ptrn3a | back to summary |
|---|---|
| private static final Pattern date_ptrn3a | |
| date_ptrn3b | back to summary |
|---|---|
| private static final Pattern date_ptrn3b | |
| date_ptrn4 | back to summary |
|---|---|
| private static final Pattern date_ptrn4 | |
| date_ptrn5 | back to summary |
|---|---|
| private static final Pattern date_ptrn5 | |
| dateTimeFormats | back to summary |
|---|---|
| private static final DateTimeFormatter dateTimeFormats | |
| DAY_MILLISECONDS | back to summary |
|---|---|
| public static final long DAY_MILLISECONDS | |
| HOURS_PER_DAY | back to summary |
|---|---|
| public static final int HOURS_PER_DAY | |
| lastCachedResult | back to summary |
|---|---|
| private static final ThreadLocal<Boolean> lastCachedResult | |
| lastFormatIndex | back to summary |
|---|---|
| private static final ThreadLocal<Integer> lastFormatIndex | |
| lastFormatString | back to summary |
|---|---|
| private static final ThreadLocal<String> lastFormatString | |
| MINUTES_PER_HOUR | back to summary |
|---|---|
| public static final int MINUTES_PER_HOUR | |
| SECONDS_PER_DAY | back to summary |
|---|---|
| public static final int SECONDS_PER_DAY | |
| SECONDS_PER_MINUTE | back to summary |
|---|---|
| public static final int SECONDS_PER_MINUTE | |
| TIME_SEPARATOR_PATTERN | back to summary |
|---|---|
| private static final Pattern TIME_SEPARATOR_PATTERN | |
| DateUtil | back to summary |
|---|---|
| private DateUtil() | |
| absoluteDay | back to summary |
|---|---|
| protected static int absoluteDay(Calendar cal, boolean use1904windowing) Given a Calendar, return the number of days since 1900/12/31.
| |
| absoluteDay | back to summary |
|---|---|
| protected static int absoluteDay(LocalDateTime date, boolean use1904windowing) Given a LocalDateTime, return the number of days since 1900/12/31.
| |
| absoluteDay | back to summary |
|---|---|
| private static int absoluteDay(int year, int dayOfYear, boolean use1904windowing) Given a year and day of year, return the number of days since 1900/12/31.
| |
| cache | back to summary |
|---|---|
| private static void cache(String formatString, int formatIndex, boolean cached) | |
| convertTime | back to summary |
|---|---|
| public static double convertTime(String timeStr) Converts a string of format "HH:MM" or "HH:MM:SS" to its (Excel) numeric equivalent
| |
| convertTimeInternal | back to summary |
|---|---|
| private static double convertTimeInternal(String timeStr) throws FormatException | |
| daysInPriorYears | back to summary |
|---|---|
| pack-priv static int daysInPriorYears(int yr, boolean use1904windowing) Return the number of days in prior years since 1900
| |
| dayStart | back to summary |
|---|---|
| private static Calendar dayStart(final Calendar cal) | |
| getExcelDate | back to summary |
|---|---|
| public static double getExcelDate(LocalDate date) Given a LocalDate, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds.
| |
| getExcelDate | back to summary |
|---|---|
| public static double getExcelDate(LocalDate date, boolean use1904windowing) Given a LocalDate, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds.
| |
| getExcelDate | back to summary |
|---|---|
| public static double getExcelDate(LocalDateTime date) Given a LocalDateTime, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds.
| |
| getExcelDate | back to summary |
|---|---|
| public static double getExcelDate(LocalDateTime date, boolean use1904windowing) Given a LocalDateTime, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds.
| |
| getExcelDate | back to summary |
|---|---|
| public static double getExcelDate(Date date) Given a Date, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds.
| |
| getExcelDate | back to summary |
|---|---|
| public static double getExcelDate(Date date, boolean use1904windowing) Given a Date, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds.
| |
| getExcelDate | back to summary |
|---|---|
| public static double getExcelDate(Calendar date, boolean use1904windowing) Given a Date in the form of a Calendar, converts it into a double representing its internal Excel representation, which is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds.
| |
| getJavaCalendar | back to summary |
|---|---|
| public static Calendar getJavaCalendar(double date) Get EXCEL date as Java Calendar (with default time zone).
This is like
| |
| getJavaCalendar | back to summary |
|---|---|
| public static Calendar getJavaCalendar(double date, boolean use1904windowing) Get EXCEL date as Java Calendar (with default time zone).
This is like
| |
| getJavaCalendar | back to summary |
|---|---|
| public static Calendar getJavaCalendar(double date, boolean use1904windowing, TimeZone timeZone) Get EXCEL date as Java Calendar with given time zone. | |
| getJavaCalendar | back to summary |
|---|---|
| public static Calendar getJavaCalendar(double date, boolean use1904windowing, TimeZone timeZone, boolean roundSeconds) Get EXCEL date as Java Calendar with given time zone.
| |
| getJavaCalendarUTC | back to summary |
|---|---|
| public static Calendar getJavaCalendarUTC(double date, boolean use1904windowing) Get EXCEL date as Java Calendar with UTC time zone.
This is similar to
| |
| getJavaDate | back to summary |
|---|---|
| public static Date getJavaDate(double date, TimeZone tz) Given an Excel date with using 1900 date windowing, and converts it to a java.util.Date. Excel Dates and Times are stored without any timezone information. If you know (through other means) that your file uses a different TimeZone to the system default, you can use this version of the getJavaDate() method to handle it. | |
| getJavaDate | back to summary |
|---|---|
| public static Date getJavaDate(double date) Given an Excel date with using 1900 date windowing, and converts it to a java.util.Date. Note If the default
| |
| getJavaDate | back to summary |
|---|---|
| public static Date getJavaDate(double date, boolean use1904windowing, TimeZone tz) Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.util.Date. Excel Dates and Times are stored without any timezone information. If you know (through other means) that your file uses a different TimeZone to the system default, you can use this version of the getJavaDate() method to handle it. | |
| getJavaDate | back to summary |
|---|---|
| public static Date getJavaDate(double date, boolean use1904windowing, TimeZone tz, boolean roundSeconds) Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.util.Date. Excel Dates and Times are stored without any timezone information. If you know (through other means) that your file uses a different TimeZone to the system default, you can use this version of the getJavaDate() method to handle it.
| |
| getJavaDate | back to summary |
|---|---|
| public static Date getJavaDate(double date, boolean use1904windowing) Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.util.Date. Note If the default
| |
| getLocalDateTime | back to summary |
|---|---|
| public static LocalDateTime getLocalDateTime(double date) Given an Excel date with using 1900 date windowing, and converts it to a java.time.LocalDateTime. Note If the default
| |
| getLocalDateTime | back to summary |
|---|---|
| public static LocalDateTime getLocalDateTime(double date, boolean use1904windowing) Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.time.LocalDateTime. Excel Dates and Times are stored without any timezone information. If you know (through other means) that your file uses a different TimeZone to the system default, you can use this version of the getJavaDate() method to handle it.
| |
| getLocalDateTime | back to summary |
|---|---|
| public static LocalDateTime getLocalDateTime(double date, boolean use1904windowing, boolean roundSeconds) Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.time.LocalDateTime. Excel Dates and Times are stored without any timezone information. If you know (through other means) that your file uses a different TimeZone to the system default, you can use this version of the getJavaDate() method to handle it.
| |
| internalGetExcelDate | back to summary |
|---|---|
| private static double internalGetExcelDate(int year, int dayOfYear, int hour, int minute, int second, int milliSecond, boolean use1904windowing) | |
| isADateFormat | back to summary |
|---|---|
| public static boolean isADateFormat(ExcelNumberFormat numFmt) Given a format ID and its format String, will check to see if the format represents a date format or not. Firstly, it will check to see if the format ID corresponds to an internal excel date format (eg most US date formats) If not, it will check to see if the format string only contains date formatting characters (ymd-/), which covers most non US date formats.
| |
| isADateFormat | back to summary |
|---|---|
| public static boolean isADateFormat(int formatIndex, String formatString) Given a format ID and its format String, will check to see if the format represents a date format or not. Firstly, it will check to see if the format ID corresponds to an internal excel date format (eg most US date formats) If not, it will check to see if the format string only contains date formatting characters (ymd-/), which covers most non US date formats.
| |
| isCached | back to summary |
|---|---|
| private static boolean isCached(String formatString, int formatIndex) | |
| isCellDateFormatted | back to summary |
|---|---|
| public static boolean isCellDateFormatted(Cell cell) Check if a cell contains a date Since dates are stored internally in Excel as double values we infer it is a date if it is formatted as such.
| |
| isCellDateFormatted | back to summary |
|---|---|
| public static boolean isCellDateFormatted(Cell cell, ConditionalFormattingEvaluator cfEvaluator) Check if a cell contains a date Since dates are stored internally in Excel as double values we infer it is a date if it is formatted as such. Format is determined from applicable conditional formatting, if any, or cell style.
| |
| isCellInternalDateFormatted | back to summary |
|---|---|
| public static boolean isCellInternalDateFormatted(Cell cell) Check if a cell contains a date, checking only for internal excel date formats. As Excel stores a great many of its dates in "non-internal" date formats, you will not normally want to use this method. | |
| isInternalDateFormat | back to summary |
|---|---|
| public static boolean isInternalDateFormat(int format) Given a format ID this will check whether the format represents an internal excel date format or not.
| |
| isValidExcelDate | back to summary |
|---|---|
| public static boolean isValidExcelDate(double value) Given a double, checks if it is a valid Excel date.
| |
| parseDateTime | back to summary |
|---|---|
| public static Double parseDateTime(String str) | |
| parseInt | back to summary |
|---|---|
| private static int parseInt(String strVal, String fieldName, int rangeMax) throws FormatException | |
| parseInt | back to summary |
|---|---|
| private static int parseInt(String strVal, String fieldName, int lowerLimit, int upperLimit) throws FormatException | |
| parseYYYYMMDDDate | back to summary |
|---|---|
| public static Date parseYYYYMMDDDate(String dateStr) Converts a string of format "YYYY/MM/DD" to its (Excel) numeric equivalent
| |
| parseYYYYMMDDDateInternal | back to summary |
|---|---|
| private static Date parseYYYYMMDDDateInternal(String timeStr) throws FormatException | |
| setCalendar | back to summary |
|---|---|
| public static void setCalendar(Calendar calendar, int wholeDays, int millisecondsInDay, boolean use1904windowing, boolean roundSeconds) | |
| toLocalDateTime | back to summary |
|---|---|
| public static LocalDateTime toLocalDateTime(Date date) Convert a Java Date (at UTC) to LocalDateTime.
| |
| toLocalDateTime | back to summary |
|---|---|
| public static LocalDateTime toLocalDateTime(Calendar date) Convert a Java Calendar (at UTC) to LocalDateTime.
| |
| Access | Constructor and Description |
|---|---|
| public |
| FormatException | back to summary |
|---|---|
| public FormatException(String msg) | |