Corruption is a key theme in this play, particularly focused on the way that the nervous transition from one ruler to the next creates a sense of unhealthy disease in the royal family and the state as a whole. It is no accident that one of the most well-remembered lines from this play is "Something is rotten in the state of Denmark." This line, said by Marcellus in Act I scene 4, links the presence of the ghost to some sort of corruption at the very core of Denmark as a country. Repeatedly characters in this play make links between the state of health of the nation and the legitimacy of its ruler, and Denmark is often compared to a body that is in a diseased state thanks to what Claudius and Gertrude have done. There is an implicit contrast between the former King Hamlet as a good, legitimate ruler, under whose care Denmark as a country flourished, and then the political and corrupt Claudius, under whose care Denmark declines. This is something that time is used to convey as this impression of "something rotten" being at the heart of Denmark intensifies as the play advances. In addition, the repeated references that Hamlet makes to his mother's relationship to her brother-in-law/husband also indicate the moral corruption of her actions:
Nay, but to live
In the rank sweat of an enseamed bed,
Stew'd in corruption, honeying and making love
Over the nasty sty,—
This reaches a climax in Act IV where Hamlet significantly accuses Gertrude of sexual corruption in her very bed chamber, which is of course an excellent use of place by Shakespeare to accuse her, as this is the precise setting where her "crimes" occur. Time and space in this play are therefore used by Shakespeare to develop the theme of corruption through both an intensifying of how corrupt Denmark is through the morally illegitimate reign of Claudius, and also the moral corruption of Gertrude herself in marrying Claudius so soon after her first husband's death.
Time in the play as Hamlet recounts in 1.5, "The time is out of joint O cursed spite That ever I was born to set it right." At the very beginning of 1.4 as Hamlet asks, "What hour now?" Horatio thinks it is not yet midnight. Marcellus though seems sure that the hour has struck. Then there is the ambiguity of how long it has been since King Hamlet's death. The events of the play unfold sequentially without regard time. Hamlet at one point in 2.2 says that will hear a play "tomorrow." Ambassadors come and go, Hamlet goes and returns, all without any sense of time. Horatio apparently has come to Elsinore for the King's funeral but doesn't meet Hamlet until the end of 1.2. In spite of critics and commentator's attempts to provide a time frame for the events in the play, ultimately I think they are futile. Time is out of joint in this play. As for place, I think it is the body politic that becomes corrupt or as the play suggests eaten from within by sickness and disease. It starts with Claudius and his whole extended family begins to feel the effects. Even to the point that the masses are willing to help Laertes storm the castle and make him king. All because Claudius has usurped the throne and the country from its rightful ruler. In the end Denmark and Elsinore purge the disease and a new rightful ruler takes over.