Did some serious ninja crap with SQL time functions.