I have a data source that contains datetime\'s I\'m reading in Python. The program always dies on the 24th hour, since python holds dates 0-23 not 1-24.
from datetime import datetime
import re
s = '2012/15/01 24'
y, d, m, h = map(int, re.findall('\d+', s))
dt = datetime(y, m, d, h - 1)
# 2012-01-15 23:00:00