How to get the time range elapsed on the dashboard into a variable?

can i do a generic query to get it? i need this value to so something.
Tkx