Employers in California must pay their workers for tasks they’re regularly required to perform for a few minutes before or after their regular work hours, the state Supreme Court ruled unanimously Thursday, rejecting a federal standard that allows employers to withhold the additional pay.

A 1946 U.S. Supreme Court ruling, written into law by Congress in 1961, said federal law did not entitle employees to be paid for working “a few seconds or minutes” beyond their scheduled hours. The high court invoked “the realities of the industrial world,” including the difficulties of keeping payroll records for such brief periods.

But states can set their own standards, and the California court said the “de minimis” federal rule — based on the Latin term for “trivial” — has never been adopted by California lawmakers or labor regulators. The court said employees may not be entitled to compensation for every minute they work off the clock, but regular daily assignments, even brief ones, must be paid for.

California labor law “contemplates that employees will be paid for all work performed,” Justice Goodwin Liu said in the 7-0 ruling.

The case involved a class-action lawsuit against Starbucks by a shift supervisor in Los Angeles who was required, after clocking out each day, to send daily sales data to corporate headquarters, and then to set the store’s alarm, lock the door and walk co-workers to their cars. The supervisor, Douglas Troester, spent four to 10 minutes on those tasks each day, a total of 12 hours and 50 minutes during 17 months of employment, worth $102.67 at the then-minimum wage of $8 an hour.

“That is enough to pay a utility bill, buy a week of groceries, or cover a month of bus fares,” Liu said. “What Starbucks calls ‘de minimis’ is not de minimis at all to many ordinary people who work for hourly wages.”

Stanley Saltzman, a lawyer for Troester, said the ruling lets employers know that “they can’t require their workers to regularly perform minutes per day of unpaid labor.” He said the ruling would apply statewide to thousands of present and past Starbucks employees, and many thousands of others in California who have been denied pay in similar circumstances.

The court said Starbucks changed its practices after the suit was filed and now pays employees for regularly required tasks outside of normal work hours. But the coffee company and major business groups argued in court filings that the justices should adopt the federal rule and spare employers from record-keeping that often cost more than the small sums of pay at issue.

Starbucks said it is disappointed by the ruling.

But John Skousen, a Southern California attorney who represents employers and was not involved in Thursday’s case, said the ruling should not cause any hardships, particularly with technological developments since the 1946 U.S. Supreme Court ruling.

“Put the time clock at the end of the building, or have an iPad method of capturing time” for each employee, Skousen said. “It’s a doable thing for employers. ... You can’t automatically cut off (work that must be compensated) when you know that it’s occurring and you can easily capture the time.”

Liu, in the court ruling, said workers shouldn’t have to pay for difficulties in record-keeping.

It isn’t “clear why, when it is difficult to keep track of time worked, the employee alone should bear the burden of that difficulty,” Liu said. He also said class-action suits, which allow individuals to join small claims in a single case, illustrate how sums that normally would not be worth the time of a single plaintiff or the court “can be aggregated to vindicate an important public policy.”

The case is Troester vs. Starbucks, S234969.

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter:@BobEgelko