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

Why sqlite3 date type not support? #627

Closed
Bpazy opened this issue Sep 1, 2018 · 3 comments
Closed

Why sqlite3 date type not support? #627

Bpazy opened this issue Sep 1, 2018 · 3 comments

Comments

@Bpazy
Copy link

Bpazy commented Sep 1, 2018

Any schedules please?

@PaluMacil
Copy link

PaluMacil commented Sep 5, 2018

There is no date type in sqlite3. See https://www.sqlite.org/datatype3.html and see #190 for more information on usage of dates.

2.2. Date and Time Datatype
SQLite does not have a storage class set aside for storing dates and/or times. Instead, the built-in Date And Time Functions of SQLite are capable of storing dates and times as TEXT, REAL, or INTEGER values:

  • TEXT as ISO8601 strings ("YYYY-MM-DD HH:MM:SS.SSS").
  • REAL as Julian day numbers, the number of days since noon in Greenwich on November 24, 4714 B.C. according to the proleptic Gregorian calendar.
  • INTEGER as Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC.

Applications can chose to store dates and times in any of these formats and freely convert between formats using the built-in date and time functions.

Make sure to look at #190 to see why you might be having trouble. By default, there is no type affinity for datetime, so you need to cast it to text.

@Bpazy
Copy link
Author

Bpazy commented Sep 6, 2018

thanks. I'm sorry about the issue.

@Bpazy Bpazy closed this as completed Sep 6, 2018
@PaluMacil
Copy link

No problem. It's confusing that sqlite doesn't have a type for it. It makes sense since everyone implements numbers different ways and many applications need to have a local database that has compatible formats with the server's database but... it still makes thinking about it a lot more complex because it's one more thing to remember.

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

2 participants