The Answer to the Puzzle
Next to code it, you put your programmers hat on. If at some point you think "Why did I design that feature- it will be a real pig to implement" then you know you've mastered the two hats approach! Keeping the design and implementation processes distinct and isolated from each other will reduce compromise and your application will be better for it. I've designed and programmed games this way and the programmer me has hated the design me but I think the games were better for it!
Challenge 14 has been updated with the source code downloads.
- Link to Programming as a Career


Actually this solution is not quite correct. Zero, unlike 1 and 2, does not need to be duplicated presuming the dice can be switched in order to allow for the combinations 23, 24, and 25 (which would be impossible if the dice had to be static). With the extra zero removed, there is room for a 9 after all.
So how do you display 04 or 08? The question did say all dates 01..31. That’s all 10 numbers 01..09.
David
I think I have a better answer:
The first die will have 0, 1, 2 each appearing twice.
The second die will have 3, 4, 5, 6, 7, 8.
Whenever you roll the dice you get a legal date, for example: 0, 3 can either be 3 or 30. This also uses your using the 6 as a 9 trick, but it can’t give you illegal dates like your solution. For example, what happens when you roll a 5 and an 8? There is no 58 or 85th date.