# Weird digital clock

Well I don't remember being naughty last year, but even so, I got this messed up digital clock from Santa. Is it because I'm not a christian? Or maybe because of my stupid comment? I just don't know.

The clock displays the digits in a weird way. Here are some examples of random digits1 displayed by the clock:

I told my cousin (who is an electrician) about it, and after taking a look at it, he told me that the clock is working perfectly fine, but its 7-segment displays are wrongly assembled. I asked him if he could fix it. He couldn't and said it was some complicated elf craftsmanship. So the only thing left for me to do is to learn how this clock displays the digits (0-9) so I can read time properly. I've been trying to figure this out on my own since then but with no luck.

I really need this clock because I gave my old one away. Now I'm either too early or too late for everything. Please help me read time using this stupid clock. Here I made a sheet2 that you can fill once you're done. I should tell you that I'll accept your answer only if after reading it (the answer) I will be able to read time correctly.

Hint #1:
This is already deduced by @Deusovi in his answer down below, so I might as well just add it here so it becomes official.

I tried contacting Santa and the elves via their Customer Service Office. They didn't say much, but they told me that D is OBVIOUSLY 8. When I told my cousin that, he said: "Not only are the segments are misplaced, but they're also inverted (ONed when they should be OFFed and vice versa)."

1. The letters above the digits are not related to the puzzle. They are there just for referencing. So to refer to the third-from-the-left digit you could just say C.
2. Flood-filling works. When you're done, just flood-fill the segments that should be ON with black.

One possible problem with your clock is that:

all the segments are inverted and moved around.
To fix it, you can permute the segments like this:

When you rearrange your segments to fix it, the red segment on the left goes to the red segment on the right, and similarly for the other colors.

Unfortunately, there's not enough information from the original digits to tell which of the gray segments on the left go to which on the right. So there are two possible ways your clock can be read.