POPS-273 calculate cut-off time in Java