Given a "time" of the form: `t = HHMMSS`, we want to convert it to a four digit number of pixels representing $100$ times the number of hours that have elapsed since midnight. Using Python $3.3$ together with the flooring and modulo operations, we can achieve this goal by doing something like this:
def time2pixels(t):
seconds = t % 100 # Get the last two digits.
minutes = int(t / 100) % 100 # Get the middle two digits.
minutes += seconds / 60.0 # Convert the seconds to minutes and add it on.
hours = int(t / 10000) # Get the first two digits.
hours += minutes / 60.0 # Convert the minutes to hours and add it on.
return int(hours * 100) # Convert from hours to pixels.
print(time2pixels(163000)) # Outputs: 1650