Mahashivratri is celebrated during the night and day just before the new moon.
Lord Shiva is said to be the destroyer for it is his power of destruction that eventually leads to regeneration. It is believed that Lord Shiva (symbolised by the new moon) appeared to save the world from darkness and ignorance.
Devotees fast on this day and stay up all night chanting hymns in praise of Lord Shiva.