Is it possible to define a datetime variable in dql?

Nope, not possible.

See this Custom Block - Discussion