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

Add support for reading unix epochs as timestamps #117

Merged
merged 4 commits into from
Sep 25, 2024

Conversation

Mytherin
Copy link
Contributor

SQLite doesn't have a canonical representation of timestamps, instead they have several different conventions:

  • ISO-8601 strings
  • (Fractional) julian days since -4713-11-24 12:00:00
  • Unix timestamps in seconds since 1970-01-01 00:00:00

Previously we only supported ISO-8601 strings. This PR extends our support to also support unix timestamps. When we encounter a SQLITE_INTEGER or a SQLITE_REAL in a TIMESTAMP or DATE column - instead of throwing an error - we parse it as a unix timestamp (in seconds).

@Mytherin Mytherin merged commit d5d6265 into duckdb:main Sep 25, 2024
22 checks 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

Successfully merging this pull request may close these issues.

1 participant