It isn't quite this. We have memories for only part of the day. We have no memories for other parts. We don't know whether we are conscious at these times. It isn't that we know we are unconscious when we are asleep except inasmuch as the term "unconscious" is sloppy and applies to whatever we are when we are asleep and the hypothetical state of existing without consciousness. These are two things we don't have direct experience with and which we assume are the same.