The real reason for the "12 O'clock Assciation" with Sikhs comes from Nadir Shah's invasion of India. His troops passed through Punjab after plundering Delhi and killing thousands of Hindus (and Muslims) , and taking hundreds of Hindu women as captive.
The Sikhs decided to attack Nadir Shah's camp and free the captive women. Being outnumbered by Nadir Shah's huge army, they could not afford to make a frontal attack. Instead, they used to make midnight guerrilla raids on Nadir Shah's camp, free as many captive women as possible, and return them to their homes in order to "restore the diginity of the Hindu community".
In jest, the Hindus would say that the Sikhs are in their senses only at night. This later became the trait of a widespread category of derisive jokes. Singh opines: "Hindus started referring to the relatively neutral 12 o'clock, rather than midnight" to avoid annoying the armed Sikhs, and the "final result was the safe, bald statement, 'It is 12 o'clock' shorn of all reference to its very interesting history."