I shared this on other forums, but not here. A few months ago I made a set of Time & Date blocks, which are now an approved extension. I’d appreciate any feedback.
They can be used for:
- Time in 12-hour or 24-hour format (Simple Example: https://makecode.microbit.org/_5kXFUaC2xeu0 . Documentation gives details about three approaches to setting the time)
- Date
- Creating simple stopwatches (Example: https://makecode.microbit.org/_2MK536dctd0m)
- Creating timestamps (YYYY-MM-DD HH:MM.SS format)
You can find them by searching for “microbit-pxt-timeanddate” in the extensions.
Documentation is here: https://makecode.microbit.org/pkg/bsiever/microbit-pxt-timeanddate
Oh, a bonus…here’s an example of a binary clock using them: https://makecode.microbit.org/_MJqeqei2aFjJ .
The time needs to be set first. Hold “A” to advance the hour, then hold “B” for a bit to move on to minute. Again hold “A” to advance the minute, then “B” to move on. Then the clock will be shown. The first two columns represent the hour, then a column that blinks “:” (off 1 second then on 1 second), then two columns for the minute. The least significant bit is the bottom row of each column.