add index according to datetime