Class ExcelStyleDateFormatter

java.lang.Object
java.text.Format
java.text.DateFormat
java.text.SimpleDateFormat
org.xlsx4j.org.apache.poi.ss.usermodel.ExcelStyleDateFormatter
All Implemented Interfaces:
Serializable, Cloneable

public class ExcelStyleDateFormatter extends SimpleDateFormat
A wrapper around a SimpleDateFormat instance, which handles a few Excel-style extensions that are not supported by SimpleDateFormat. Currently, the extensions are around the handling of elapsed time, eg rendering 1 day 2 hours as 26 hours.
See Also:
  • Field Details

  • Constructor Details

    • ExcelStyleDateFormatter

      public ExcelStyleDateFormatter(String pattern)
    • ExcelStyleDateFormatter

      public ExcelStyleDateFormatter(String pattern, DateFormatSymbols formatSymbols)
    • ExcelStyleDateFormatter

      public ExcelStyleDateFormatter(String pattern, Locale locale)
  • Method Details

    • processFormatPattern

      private static String processFormatPattern(String f)
      Takes a format String, and replaces Excel specific bits with our detection sequences
    • setDateToBeFormatted

      public void setDateToBeFormatted(double date)
      Used to let us know what the date being formatted is, in Excel terms, which we may wish to use when handling elapsed times.
    • format

      public StringBuffer format(Date date, StringBuffer paramStringBuffer, FieldPosition paramFieldPosition)
      Overrides:
      format in class SimpleDateFormat
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class SimpleDateFormat
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class SimpleDateFormat