- java.lang.Object
-
- org.dhatim.fastexcel.TimestampUtil
-
-
Field Summary
Fields Modifier and Type Field Description static longDAY_MILLISECONDSDeprecated.static intHOURS_PER_DAYDeprecated.static intMINUTES_PER_HOURDeprecated.static intSECONDS_PER_DAYDeprecated.static intSECONDS_PER_MINUTEDeprecated.
-
Constructor Summary
Constructors Constructor Description TimestampUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DoubleconvertDate(LocalDate localDate)Convert aLocalDateto a serial number.static DoubleconvertDate(LocalDateTime localDateTime)Convert aLocalDateTimeto a serial number.static DoubleconvertDate(Date date)Convert aDateto a serial number.static DoubleconvertInstant(Instant instant)Convert anInstantto a serial number.static DoubleconvertZonedDateTime(ZonedDateTime zonedDateTime)Convert aZonedDateTimeto a serial number.
-
-
-
Field Detail
-
SECONDS_PER_MINUTE
@Deprecated public static final int SECONDS_PER_MINUTE
Deprecated.- See Also:
- Constant Field Values
-
MINUTES_PER_HOUR
@Deprecated public static final int MINUTES_PER_HOUR
Deprecated.- See Also:
- Constant Field Values
-
HOURS_PER_DAY
@Deprecated public static final int HOURS_PER_DAY
Deprecated.- See Also:
- Constant Field Values
-
SECONDS_PER_DAY
@Deprecated public static final int SECONDS_PER_DAY
Deprecated.- See Also:
- Constant Field Values
-
DAY_MILLISECONDS
@Deprecated public static final long DAY_MILLISECONDS
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
convertDate
public static Double convertDate(Date date)
Convert aDateto 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 usingconvertZonedDateTime(java.time.ZonedDateTime).- Parameters:
date- Date value.- Returns:
- Serial number value.
-
convertDate
public static Double convertDate(LocalDateTime localDateTime)
Convert aLocalDateTimeto a serial number.- Parameters:
localDateTime- Local date time value.- Returns:
- Serial number value.
-
convertDate
public static Double convertDate(LocalDate localDate)
Convert aLocalDateto a serial number.- Parameters:
localDate- Local date value.- Returns:
- Serial number value.
-
convertZonedDateTime
public static Double convertZonedDateTime(ZonedDateTime zonedDateTime)
Convert aZonedDateTimeto a serial number.- Parameters:
zonedDateTime- Date and timezone values.- Returns:
- Serial number value.
-
-