Current Date and Time¶
GlueSQL provides a function to get the current date and time: now.
Now - now¶
The now function returns the current date and time.
let actual = table("Record")
.select()
.filter(col("time_stamp").gt(now())) // select rows where "time_stamp" is later than current time
.project("id, time_stamp")
.execute(glue)
.await;
In the above example, the filter method uses now to select rows where the "time_stamp" column is later than the current time.
When inserting data into a table, you can use the now function to record the current time: