I lay down in my gown upon my bed and slept till the 4 o’clock gun the next morning waked me, which I took for 8 at night, and rising to piss mistook the sun rising for the sun setting on Sunday night.
Wonderful.
Presumably the 4 o'clock gun is Monday morning, not Sunday morning. So he went to bed on Sunday afternoon and woke up next morning, thinking it was still evening. He then found he had "lost" the night.
Or if the 4 o'clock gun is Sunday morning, he went to bed during Saturday night, and waking early in the morning he thought it was already evening. He then found he still had the whole of day ahead of him.
Either way, lovely description of an erroneous time frame.