If we're looking for someone to blame, it may as well be William Murdoch (later known, for reasons unclear, as Murdock). The flammability of coal gas had already been established. Back in 1735, Dr John Clayton of Wigan had entertained the members of the Royal Society in London with an account of how he had burned a few lumps of the black stuff, released "the spirit of coal", captured it in animal bladders and, to the great amusement of his friends, set it alight.

But it was Murdoch who, in Britain at least, pioneered the practical use of this party trick for the purposes of lighting. An early steam buff, he worked out how to produce and store coal gas so that, by 1792, he was able to light his house in Redruth, Cornwall. Five years later, he illuminated the entrance to the premises of the Manchester commissioners of police, followed by the inside – and, to the wonder of the local populace, the outside – of James Watts and Matthew Boulton's famous foundry in Birmingham.

Darkness, our primordial dread, was about to lose its dominion. It did not take long for the satanic mills and factories of the industrial revolution to grasp the promising implications of this fine new invention for the number of hours that could profitably be worked in a day. By 1807, arguably the world's first gas-fired public street lamps, 13 of them, were installed along Pall Mall in London by a German-born inventor called Friedrich Winzer (or Frederick Winsor).

Similar progress was being made abroad. Philippe le Bon demonstrated a gas-fired street light in Paris in 1801, and various displays took place in America. But the honour of building the first commercial gasworks in the world went, in 1812, to the London and Westminster Gas Light and Coke Company, which used wooden pipes to light Westminster bridge in time for New Year's Eve, 1813.

Baltimore became the first US city to be lit by gas in 1816. Germany's inaugural gasworks opened in Hannover in 1825. By that year in London, more than 40,000 gas lights were burning bright along more than 215 miles of the capital's streets: the night, as mankind had known it pretty much since it first walked the earth, was on its way to being banished – along with the whole culture of customs, beliefs, rituals and fears that had grown up around it.

On the whole, at the time, this was probably a welcome development. Gas was not the first form of artificial lighting, but it was by far the most efficient: a single gas mantle emitted 12 times as much light as a candle or oil lamp, and was 75% cheaper.

No one really knows whether we were born with an instinctive fear of the dark, or we acquired it gradually as a result of the myriad awful dangers that emerged after night fell. What is certain, according to Roger Ekirch, author of a compendious and enthralling history of the night called At Day's Close, is that never in human history had we been more afraid of the night than in the period that immediately preceded our ability to vanquish it.

For starters, there were the imagined enemies. The darkness, pitch black and impenetrable, was the realm of the hobgoblin, the sprite, the will-o'-the-wisp, the boggle, the kelpie, the boggart and the troll. Witches, obviously, were "abroad" (a weighty word to describe the now-banal business of venturing outdoors after dark). If you were seriously unlucky, you could run into Satan himself. To ward off these evil spirits, we prayed – a lot. The superstitious "crucked" their thumbs inside their fists, or turned their pockets (even their clothes) inside out.

Then there were the real enemies. For the night was also the realm of the criminal: the vandal, the thief, the murderer. The philosopher Thomas Hobbes's greatest fear was "being knockt on the head for five or 10 pounds". Gangs of men with names such as the Mohocks, the Scowrers and the Hectors roamed the streets of England wreaking unimaginable havoc, slashing the faces of pedestrians and "misusing women in a barbarous manner".

In Munich, the nightly purpose of one such gang was to murder the first man they met. The murder rate per head of the population was, historians estimate, five to 10 times as high as today. Dissolute youngsters amused themselves by hanging dead cats from honest citizens' doors. Theft – of crops, animals, fish from ponds, trees from gardens – was rife. Graves were ransacked, outhouses pilfered, flimsy dwellings robbed. "Nightsneaks" intent on burglary would creep into houses during the day, and emerge from their hiding places after nightfall.

The only protection against all these ne'er-do-wells was the night watch, often a motley collection of easily corrupted incompetents, universally mocked. In an age of open fires, timber buildings and no running water, fire was an even greater danger, capable of destroying whole neighbourhoods in hours. Arsonists prospered, despite the threat of execution by burning or beheading.

Yet despite its many dangers, the night held a mighty appeal. "Large numbers of people came up for air when the sun went down," says Ekirch. "It afforded them the privacy they did not have during the day. They could no longer be overseen by their superiors." Night was not only a great leveller; it overturned the social order of the day. Apprentices, servants, the poor, the excluded and the underprivileged could for once escape the eyes of their masters, employers and oppressors: darkness was their mask.

Those fearful of arrest could move safely under cover of darkness. Lovers could tryst, adulterers could couple, prostitutes could work, homosexuals could meet. Symbols of authority such as the crucifix and the coat of arms evaporate in the dark, and there were plenty to resent their reappearance with the arrival on our streets of the gas lamp – along, incidentally, with a proper police force, its job at long last made possible by the helpful transformation of night into day. The Metropolitan police was born in 1829, as gas lamps multiplied.

Street lighting was, self-evidently, a powerful weapon of both economic and social control, and in the urban riots that swept much of Europe in the 1830s and 40s, gas lamps were invariably one of the first targets, for symbolic as well as practical reasons. At the same time, advances in lighting seem almost to have foreshadowed advances in thought: Professor John Carey has noted that the dawn of the age of Enlightenment is usually put at the beginning of the 18th century, when street oil lamps first appeared in Paris, and that Nietzsche's announcement of "the death of God" coincided with the appearance of the electric light bulb, "invented" by at least 22 people before an improved version was successfully commercialised by Thomas Edison from 1879.

The pre-industrial night, however, was widely regarded with dread and fascination in equal measure: "I curse the night," confessed William Drummond in 1616, "but doth from day me hide." Or, as Thomas Tryon, a writer of popular self-help books, put it rather more pompously in 1691: "Let the night teach us what we are, and the day what we should be."

But those who had good reason, legitimate or illicit, to venture outdoors "during the night season" nonetheless developed a whole range of tricks to help them. In an age before widespread light pollution, the illumination of the moon and the stars was far more useful (on a clear night, starlight alone cast shadows). People knew their neighbourhoods intimately: every tree, every hedge, every post. On the Downs, great piles of chalky soil, known as "down lanterns", served as beacons. Bark would be cut from strategic trees to expose the lighter wood beneath. The senses of hearing (barking dogs), smell (a honeysuckle bush) and touch (a notch cut in a banister at a sharp turn in the stairs) became all the more important.

For before artificial lighting, indoors was just as treacherous as outdoors: in Sweden, it was common practice to push the furniture against the walls before retiring to bed, so you wouldn't bump into it if you rose in the middle of the night. Man had advanced, by the late 18th century, from the first flaming torches through primitive lights (made, as long as 15,000 years ago, by placing moss or some other fibre in a shell or hollow stone, and filling it with animal fat) to, on the continent at least, handsome pottery and metal oil lamps sporting sophisticated wicks and artfully sealed reservoirs filled with olive, sesame, fish, nut or plant oil.

In Britain, for some reason, we favoured candles. As a rough estimate, one 60-watt electric bulb generates the light of approximately 100 candles. By the late 1700s, most of our aristocratic homes would have been lit by a selection of candles made of expensive beeswax, or perhaps from even more expensive spermaceti, the wax extracted from the head cavities of sperm whales. The middle class used tallow candles, which stank to high heaven, smoked incessantly, dripped terribly, emitted a feeble light, but were a damn sight cheaper. The poor, overwhelmingly, made do with humble rush lights: reeds dipped in some form of animal fat. These burned even more unevenly than tallow candles and smelled worse, but did the job, more or less, for an hour or so.

What job were they required to do? What did decent folk do after dark? The upper-class young blades drank the night away. Men in towns and cities took themselves to an alehouse. Others had chores after the evening meal: furniture to build, tools to repair, beer to brew. Women carded and spun wool, and wove it. There were parlour games to play, folk tales to tell, gossip to swap, friends and family to entertain. The literate few read, or wrote. And then, by 9pm or at the latest 10, to bed.

Once there, Ekirch relates in perhaps his most fascinating revelation, pre-industrial man slept a segmented sleep. He has found more than 500 references, from Homer onwards, to a "first sleep" that lasted until maybe midnight, and was followed by "second sleep". In between the two, people routinely got up, peed, smoked, read, chatted, had friends round, or simply reflected on the events of the previous day – and on their dreams. (Plenty also had sex, by all accounts far more satisfactorily than at the end of a hard day's labouring. Couples who copulated "after the first sleep", wrote a 16th-century French doctor, "have more enjoyment, and do it better".)

Experiments by Dr Thomas Wehr at America's National Institute of Mental Health appear to bear out the theory that this two-part slumber is man's natural sleeping pattern: a group of young male volunteers deprived of light at night for weeks at a time rapidly fell into the segmented sleep routine described in so many of Ekirch's documentary sources. It could even be, Wehr has theorised, that many of today's common sleeping disorders are essentially the result of our older, primal habits "breaking through into today's artificial world".

Of all this have we been robbed by the onward march of industrial lighting. (By we, of course, I mean most people in the developed world. It's worth remembering that there are still large parts of the globe where it's still up at sunrise, and to bed pretty soon after sundown.)

In the west, the ongoing elimination of the night through the 19th and 20th centuries may have performed miracles for economic activity, encouraging the development of an entire nocturnal sector of clubs, bars, restaurants, even supermarkets now open 24/7, not to mention all-night TV. But in some ways, argues Ekirch, rather than making night-time more accessible, we are actually risking its gradual extinction.

City-dwellers, and many others, have now all but lost their view of the heavens, a source of awe and wonder since the beginning of time. And since affordable artificial lighting now allows all of us to go to bed so much later, consolidating our sleep into one more or less continuous spell, our dreamlife has been disrupted and our understanding of ourselves impaired. "With darkness diminished," he says, "the opportunities for privacy and reflection are lessened." Which is perhaps not entirely a good thing. So thanks, William Murdoch.

Daylight robbery: why did we put the clocks back?

That's it, then: winter's on the way – and not because the leaves are off the trees, or the mercury's dipping at night. No, what's clinched it is the end of British summer time, and the way the sun suddenly seems to be abandoning us an hour earlier.

Always a bit hard to get the old head around, British summer time. The point is that while we can't shift the times of sunrise and sunset, we can, if those times don't particularly suit, shift our clocks, so that the hours of daylight better match our living patterns. That's the idea, anyway.

The problem is that British summer time, known internationally as daylight saving time, or DST, was, as the name implies, invented for summer: we shift the clocks forward an hour at the end of March, so instead of getting light at, say, 4am in summer, which is no use to anyone because we're all safely tucked up in bed, it actually gets light at 5am. Consequently, instead of getting dark again at 8pm, it gets dark at 9pm, allowing us all to be out and about making the most of all those balmy summer evenings (or something).

Unfortunately, during the shorter winter day we shift the clocks back to Greenwich mean time again, so while the mornings are marginally lighter, it gets dark soon after lunch.

The man responsible for this is William Willett, a Kentish builder who campaigned tirelessly for DST. He resented having to cut his golf round short at dusk, so in 1907 proposed changing the summer clock by 80 minutes: 20 minutes forward on successive Sundays in April, and back by the same amount on September Sundays.

Besides increasing the amount of time the population could devote to improving outdoor recreational pursuits, Willett reckoned this would save £2.5m in lighting costs. Churchill fancied the idea, as did the managing director of Harrods and King Edward VII, who himself operated a cunning half-hour DST system at his Sandringham estate. But the prime minister, and several other leading figures, didn't, and in the end it was Germany, eager to save coal in wartime, that first adopted DST, a month before Britain came round in May 1916.

And the debate has raged ever since. Broadly speaking, retailers love DST because it gives people more daylight to shop in, and governments argue that the greater leisure and sports opportunities contribute to the health and happiness of the nation. Farmers dislike it, because their hours are best dictated by the sun, and cinemas and the like complain it discourages evening entertainment.

There is an alternative. Safety campaigners from the Royal Society for the Prevention of Accidents and the Local Government Association have long believed British summer time (GMT + 1) should continue through winter, and that "double summer time" (GMT + 2) should operate from March to October – meaning that Britain would, in effect, join France, Germany and Spain in the central European time zone.

The theory is that lighter evenings would not only boost the leisure and tourism industries, but reduce accidents (as they did during a brief trial in the 1960s). But farmers and other outdoor workers, and most northerners, reject any change, which would mean that in winter the sun would not rise in Scotland and Northern Ireland until after 10am.

Some bold folk have suggested that decisions on DST could perhaps be devolved. But it seems the prospect of Britain adopting the same time zone as much of the rest of western Europe is, for the time being, about as appealing (and as likely) as it adopting the same currency. Those lovely four o'clock winter nightfalls are, at present, here to stay.