feat: add java.sql.Time converter support - #1092
Open
SummerC0zyR0ck wants to merge 3 commits into
Open
Conversation
SummerC0zyR0ck
force-pushed
the
feature-sql-time-converter
branch
from
September 11, 2026 05:52
47ffb67 to
57b95ff
Compare
SummerC0zyR0ck
force-pushed
the
feature-sql-time-converter
branch
from
September 11, 2026 08:51
57b95ff to
d07e5be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the pull request
Related: #1017
Add first-class converter support for
java.sql.Time, following the existingLocalTimeconverter pattern.What's changed?
java.sql.Timerepresents a time-of-day value, but converter lookup uses the declared Java class. Therefore, the existingjava.util.DateandLocalTimeconverters do not apply to fields declared asjava.sql.Time.This PR adds a converter family under
org.apache.fesod.sheet.converters.sqltime:SqlTimeDateConverter- default write path using an ExcelDATEcell. It attachesDateUtils.EPOCH(1970-01-01) and appliesHH:mm:ssby default.SqlTimeNumberConverter- bidirectional Excel numeric serial conversion, includinguse1904windowing. Reading extracts the time component and discards any date component.SqlTimeStringConverter- bidirectionalSTRINGconversion. It defaults toHH:mm:ss, auto-detectsHH:mminput, and respects@DateTimeFormatand the configuredLocale.The converters reuse the existing
LocalTimeparsing, formatting, and Excel serial handling throughTime.toLocalTime()andTime.valueOf(LocalTime). No time-zone conversion is introduced.Registration in
DefaultConverterLoaderfollows theLocalTimepattern:initAllConverter()Tests
Tests cover converter keys, DATE/NUMBER/STRING conversion, custom date-time formats, 1904 date windowing, discarding the date component from numeric values, registry immutability, and round-trip behavior for XLSX, XLS, and CSV.
The complete
fesod-sheettest suite passes with 923 tests, and bothspotless:checkand Apache RAT checks are green.Scope is limited to
java.sql.Timeand remains JDK 8 compatible.