Science Oxford Logo

Time Travel!

The RTC boards were taught the correct time, and will be able to keep track of it for a long time.

You can teach them a different time, to make the micro:bit think that it is 100 years ago, or 20 years in the future!

The instruction to set the time is in this line:

set_time(0, 0, 10, 6, 15, 1, 2022)

These numbers are, in order:

When we set them, the RTCs were told it was 10 o'clock on Saturday 15th January, 2022.

When do you want the micro:bit to think it is?


Decide on a date, then find out what day of the week it was or will be on that date.

For example, if I want the micro:bit to think that it is the time that Neil Armstrong landed on the Moon...

In UK time, that was 3:56 on Monday 21st July 1969.

So I would change the line of code to look like this:

set_time(0, 56, 3, 1, 21, 7, 1969)


Choose your own date and time, in the past or the future - remember to work out what day of the week it would be on that day!

The set_time() should be line 21 in your program - it will look green at the moment because the micro:bit has been told to ignore it!


When you flash your code, the micro:bit will go back or forward in time, and start timing from your chosen date!