July will be late this year, because the last minute of June will have 61 seconds. In the unlikely event that you are awake as midnight (GMT) approaches next Tuesday, and looking closely at an atomic clock, you might even notice it. While 23:59 and 59 seconds normally turns to 00:00:00 – midnight – a strange additional second will make the time 23:59:60.

Without leap seconds, time would eventually drift so much that 1pm would no longer be associated with lunch, and "morning" could become afternoon. Extra seconds, along with leap years, are a crude way of keeping our day in synch with Earth and its seasons. Yet, as global systems demand ever greater precision, these awkward leaps are dividing the keepers of the world's clocks.

At the National Physical Laboratory (NPL) in west London, engineers have spent weeks getting ready to add the leap second to the official time set by its atomic clocks, while warning of the risks of being unprepared. When the last leap second kicked in, on a Saturday night in June 2012, websites including Reddit and LinkedIn faltered as servers got confused. In Australia, more than 400 flights were delayed as the Qantas check-in system crashed.

"This time, the leap second comes on a Tuesday, in the middle of the trading day in the Far East and at the end of trading on the West Coast of the US," says Leon Lobo, who is in charge of "selling" time at NPL, mainly to the finance sector. "Anyone who conducts transactions with those markets when the change occurs could have a synchronisation issue if they are not ready."

In the mid-19th century, British cities still kept their own time, determined by the sun in each place. It meant, for example, that Bristol and London were five minutes apart. But as the first railways linked cities, and telegraph communications were taking off, chaos would have ensued, so Britain agreed to a mean time, later to be set for the world at Greenwich. (Greenwich Mean Time was the forerunner of Coordinated Universal Time, the current global standard.)

But modern networks distribute not trains but cash or data. And, at the speed of light, clocks need to be synchronised at the microsecond level (a millionth of a second). In 2013, high-frequency traders, who race to make multiple, rapid trades automatically using computer algorithms, waited for the publication of key US manufacturing data. Rival news wires were due to release it at 10am sharp. But a synchronisation glitch meant that Reuters published at 09:59:59.985. In the following blink of a robot's eye (or 15 thousandths of a second), Reuters' clients made trades worth an estimated £18m. Those who had to wait until 10am were furious.

As crime agencies investigate the potentially wilful exploitation of these tiny gaps, time labs are trying to close them. Last year, NPL began channelling time from its clocks in West London to a data centre in the City, along a dedicated fibre optic cable. This way, "city time" is synchronised and accurate to the nearest microsecond. Ultimately, there are plans to put a global master clock in space, where the stability of orbit would overcome many of the barriers to perfect synchronisation on Earth.

We can blame old-fashioned ingenuity for these modern problems, including the clunky leap second. Lobo has come to the Science Museum in London to celebrate the device that made it all happen. It looks like a steam-powered toboggan, but when NPL scientists built Caesium I, in 1955, it was the world's most precise machine, and the first source of accurate atomic time. It worked like any clock, by producing a regular movement. The higher the frequency of that movement, the more stable and accurate the time. Pendulums, then quartz crystals, used to be good enough, but Louis Essen, the Nottingham physicist who led the NPL team, built a machine that could measure how often electrons inside a caesium atom jumped between two energy levels, using microwaves and magnets. A second would no longer be defined as a fraction of a solar day, but the time needed for 9,192,631,770 of these oscillations.

Essen's clock, built 60 years ago, was so accurate it neither lost nor gained a second in three centuries. But the quest for greater accuracy goes on. Today's atomic clocks would take 158 million years to lose or gain a second. "And the clocks we are developing now will lose or gain a second over the lifetime of the universe," says Lobo. That's 14 billion years, give or take.

Why so accurate? Because time is behind everything. Your satnav knows where you are, to the nearest few metres, because atomic clocks in satellites time the signals that travel between you and space to produce a location. Autonomous cars need greater precision, and therefore better time. Meanwhile, power grids, air traffic control systems and mobile phone networks would grind to a halt without accurate, synchronised time.

"The whole development of technology is about making things easier to use without necessarily understanding how it works," Lobo says. "That isn't a bad thing but it means we can take for granted how many aspects of what we see and use every day are dependent on time."

But such accuracy also throws up a problem. Earth's rotation, which is influenced by factors including the moon's pull, is slowing down, making our days longer. So, since 1972, the world has agreed to add a leap second to our clocks when the gap between atomic time and shaky old Earth time approaches a second. Next week's leap second will be the 27th and each time it happens, companies have to adjust. Google gets round it by slowing its clocks throughout leap day, making each second a tiny bit longer and cancelling the need for a confusing new one.