We know this because in Act 1 Scene 2, Hamlet says “Heaven and earth!
Hamlet: Soliloquy Act 1 Scene 2 ..
This part of the quote also relates to later on in Act 3, Scene 1, lines 121-122, when Hamlet addresses Ophelia: “Why wouldst thou be a breeder of sinners?” The sun relates to Hamlet Senior, who has often been compared with Hyperion, the sun god, for being a war-like king.
Act 1, Scene 1 | Hamlet | William Shakespeare | Lit2Go ETC
The importance of the sun can be seen when Claudius asks, “How is it that the clouds still hang on you?” Hamlet replies, “Not so, my lord; I am too much in the sun” (Act 1, Scene 2, Line 67).