Calculate time variable

Maybe this can be of help

and / or