We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Originally posted by finnbear September 23, 2022
SurrealDB implements division for datetime divided by duration, which truncates the datetime to the duration:
SELECT * FROM time::now() / 1w;
The implementation of the feature is questionable because:
v
w
surrealdb/lib/src/sql/value/value.rs
Line 1234 in 5fe1fd0
The feature itself is questionable because:
surrealdb/lib/src/sql/duration.rs
Lines 207 to 218 in 5fe1fd0
time::floor
surreal 1.0.0-beta.7 for windows on x86_64
The text was updated successfully, but these errors were encountered:
25926cb
tobiemh
No branches or pull requests
Discussed in https://github.com/orgs/surrealdb/discussions/1207
Originally posted by finnbear September 23, 2022
Is your feature request related to a problem?
SurrealDB implements division for datetime divided by duration, which truncates the datetime to the duration:
The implementation of the feature is questionable because:
v
andw
are reversed here (should bev
/w
):surrealdb/lib/src/sql/value/value.rs
Line 1234 in 5fe1fd0
The feature itself is questionable because:
surrealdb/lib/src/sql/duration.rs
Lines 207 to 218 in 5fe1fd0
Describe the solution
time::floor
seems like a canonical, much more clear way to truncate datetimesAlternative methods
time::floor
function to truncate datetimes to specific durations.SurrealDB version
surreal 1.0.0-beta.7 for windows on x86_64
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: