What is the Best way to define Shifts using db Time Stamp

Another poster prompted me to dig my solution out of my archive. Posted over there: