Class TimestampUtil


  • public final class TimestampUtil
    extends Object
    Excel timestamp utility methods. For more information, check this out.
    • Constructor Detail

      • TimestampUtil

        public TimestampUtil()
    • Method Detail

      • convertDate

        public static Double convertDate​(Date date)
        Convert a Date to a serial number. Note Excel timestamps do not carry any timezone information; this method uses the system timezone to convert the timestamp to a serial number. If you need a specific timezone, prefer using convertZonedDateTime(java.time.ZonedDateTime).
        Parameters:
        date - Date value.
        Returns:
        Serial number value.
      • convertDate

        public static Double convertDate​(LocalDate date)
        Convert a LocalDate to a serial number.
        Parameters:
        date - Local date value.
        Returns:
        Serial number value.
      • convertZonedDateTime

        public static Double convertZonedDateTime​(ZonedDateTime zdt)
        Convert a ChronoZonedDateTime to a serial number.
        Parameters:
        zdt - Date and timezone values.
        Returns:
        Serial number value.