Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp column not retrieving values in UTC time zone #2431

Open
rihi opened this issue Feb 25, 2025 · 0 comments
Open

Timestamp column not retrieving values in UTC time zone #2431

rihi opened this issue Feb 25, 2025 · 0 comments

Comments

@rihi
Copy link

rihi commented Feb 25, 2025

I believe the recent pull request #2386 tried to fix the behavior of timestamp columns (KotlinInstantColumnType, JavaInstantColumnType) to always store values in UTC.
However, on my system with SQLite, retrieving timestamps from a database results in the UTC timestamps being interpreted as if they were in my system local time zone.

I believe the cause to be the following lines of code:

override fun readObject(rs: ResultSet, index: Int): Any? {
return rs.getTimestamp(index)
}

override fun readObject(rs: ResultSet, index: Int): Any? {
return rs.getTimestamp(index)
}

This uses ResultSet#getTimestamp(index), which yields timestamp objects which are in the system local time zone if no calendar object is explicitly passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant