def get_datetime_at_period_ix(self, ix):
if self.timestep_period_duration == TimePeriod.millisecond:<EOL><INDENT>return self.start_datetime + timedelta(milliseconds=ix)<EOL><DEDENT>elif self.timestep_period_duration == TimePeriod.second:<EOL><INDENT>return self.start_datetime + timedelta(seconds=ix)<EOL><DEDENT>elif self.timestep_period_duration == TimePeriod.minute:<EOL><INDENT>return self.start_datetime + timedelta(minutes=ix)<EOL><DEDENT>elif self.timestep_period_duration == TimePeriod.hour:<EOL><INDENT>return self.start_datetime + timedelta(hours=ix)<EOL><DEDENT>elif self.timestep_period_duration == TimePeriod.day:<EOL><INDENT>return self.start_datetime + relativedelta(days=ix)<EOL><DEDENT>elif self.timestep_period_duration == TimePeriod.week:<EOL><INDENT>return self.start_datetime + relativedelta(days=ix*<NUM_LIT:7>)<EOL><DEDENT>elif self.timestep_period_duration == TimePeriod.month:<EOL><INDENT>return self.start_datetime + relativedelta(months=ix)<EOL><DEDENT>elif self.timestep_period_duration == TimePeriod.year:<EOL><INDENT>return self.start_datetime + relativedelta(years=ix)<EOL><DEDENT>
Get the datetime at a given period.

:param period: The index of the period.

:returns: The datetime.