add index according to datetime
update file with "fromtime", indicating what
need to be updated.