Projections - window last 5 minutes

Greg mentioned in this video https://www.youtube.com/watch?v=DWhQggR13u8 that we can create a projection:

fromAll() …

(get all events from the last 5 minutes forward)

Sorry if this is a newby question but how do I create this projection?

How would I write it if I wanted the last x number of events forward?

There isn't a helper for this now but each event comes with a date time on it.

I assume you want this as a query? It doesn't make much sense as a
continuous projection.

Take a look at this projection: https://github.com/pawelkaczor/akka-ddd/blob/master/akka-ddd-scheduling/src/main/resources/current-deadlines.js
The idea is to use internal $stats stream as a time stream (clock) which is then used to create “window” stream.