function use the dataframe index as time column