Out of the night that covers me,
Black as the pit from pole to pole,
I thank whatever gods may be
For my unconquerable soul.
The “night” creates the mood and tone of the poem. It symbolizes hardship or deep unhappiness; perhaps a negative time of the poet’s life. 
 Another view is that the night is a time of quiet, when the poet can contemplate his life and reason himself into strength and fortitude.
Invictus