Changed all ints representing time to datetimes

Changed all ints representing time to datetime objects. Still need to
connect to the database and test this code. Additionally, fixed bug in
simulator (renamed a variable).