Round a timestamp to nearest day

Everything is in the title,

How could I round a timestamp to nearest day, example:
1625725718
TO
1625727600

Hello @tard.gabriel :slight_smile:

I guess it follows the same principle as in other languages so maybe this post will help you.

Regards,
Cobra

I got a part of the answer but I got this curious error:


Invalid input '(': expected an identifier character, whitespace, '.', node labels or rel types, '[', '^', '*', '/', '%', '+', '-', "=~", IN, STARTS, ENDS, CONTAINS, IS, '=', '~', "<>", "!=", '<', '>', "<=", ">=", AND, XOR, OR, AS, ',', ORDER, SKIP, LIMIT, WHERE, FROM GRAPH, USE GRAPH, CONSTRUCT, LOAD CSV, START, MATCH, UNWIND, MERGE, CREATE UNIQUE, CREATE, SET, DELETE, REMOVE, FOREACH, WITH, CALL, RETURN, UNION, ';' or end of input (line 1, column 50 (offset: 49))
"WITH datetime({epochSeconds:1625726538}).truncate('day') AS date"
WITH datetime.truncate('day', datetime({epochSeconds: 1625726538})) AS date
RETURN *
1 Like