Exercise

March 29, throughout a decade

Daylight Saving rules are complicated: they're different in different places, they change over time, and they usually start on a Sunday (and so they move around the calendar).

For example, in the United Kingdom, as of the time this lesson was written, Daylight Saving begins on the last Sunday in March. Let's look at the UTC offset for March 29, at midnight, for the years 2000 to 2010.

Instructions

100 XP
  • Using tz, set the timezone for dt to be 'Europe/London'.
  • Within the for loop:
  • Use the .replace() method to change the year for dt to be y.
  • Call .isoformat() on the result to observe the results.