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

Support additional DateTime formats and common datetime queries #14

Open
bcardiff opened this issue Dec 26, 2016 · 1 comment
Open

Support additional DateTime formats and common datetime queries #14

bcardiff opened this issue Dec 26, 2016 · 1 comment

Comments

@bcardiff
Copy link
Member

Currently (0.8.1) when reading/writing Time values the format SQLite3::DATE_FORMAT is used. This is one of the supported formats by sqlite. It is actually the one with more precision: YYYY-MM-DD HH:MM:SS.SSS

This is enough for reading/writing values using Time crystal's type. But it would be proper to allow reading time values using a fallback for all other DateTime formats described in https://www.sqlite.org/lang_datefunc.html so the following queries will work:

  • select date('now');
  • select datetime('now');
  • SELECT current_timestamp;

This should be handled in

Time.parse read(String), SQLite3::DATE_FORMAT

@Zhomart
Copy link

Zhomart commented Mar 24, 2017

Suggestion to use %F %T.%L%:z as default time format. Example is 2017-03-24 13:10:29.904-07:00. It includes timezone.

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