There soon won’t be a silver lining to paying spousal support.

Time is running out to lock in a federal tax deduction on alimony payments. President Trump’s new tax code will abolish tax deductions on alimony for divorce decrees on Jan. 1, 2019 and thereafter. “This will create a total reevaluation of divorce cases,” said Malcolm Taub, partner and co-chair of the divorce and family law practice group at Davidoff Hutcher & Citron LLP. “It’s major.”

Peter Walzer, president of the American Academy of Matrimonial Lawyers and a partner at the law firm Walzer Melcher LLP in Woodland Hills, Calif., said anyone currently going through divorce proceedings should ask their attorney about the tax law change and its potential impact on their settlement. “Waiting until 2019 could result in more alimony money going to taxes instead of household expenses,” he said.

The American Academy of Matrimonial Lawyers offers this advice

• The alimony agreement needs to be in a final settlement or court order — not a temporary agreement — in order to maintain the deduction.

• If you have a premarital agreement that includes an alimony provision, the agreement could be tied to assumptions about tax implications that soon will be out of date.

• In some cases, both ex-spouses can lock in tax benefits by finalizing the agreement this year. Middle-class families could be most impacted by the law.

The wealthier spouse may have more leverage

Divorce lawyers say the higher-earning spouse will have more leverage to argue for lower alimony. “We settled a case this week in court where my wealthy client agreed to pay his dependent wife significant alimony because he could deduct it,” said Randy Kessler, an Atlanta-based lawyer who wrote the book, “Divorce: Protect Yourself, Your Kids, and Your Future.” “The deduction, as it stands, is a great motivator to encourage the higher wage earner to agree to help support the spouse with less income.”

Current tax rules allow for matrimonial attorneys to craft a settlement whereby it is possible to make larger payments to the payee spouse at a lesser after-tax cost to the payor, said Lisa Zeiderman, founding partner of Miller Zeiderman and Weiderkehr in New York. “This benefits everyone. The payor receives the benefit of a reduced tax obligation and the payee receives the benefit of more income than might otherwise be forthcoming if the payee spouse wasn’t receiving the benefit of the tax deduction.”

So how much is written off or deducted?

The answer to that question all depends on how much the higher earner pays in income taxes. If the higher earner typically pays 39% in taxes, they deduct 39% of what they pay in alimony. If they make $1 million per year and pay $100,000 a year in spousal support then they only pay taxes on their remaining $900,000 in income. But if they are in a 20% tax bracket, then they only pay $20,000 in taxes on the $100,000 alimony and, thus, the government only gets $20,000 in taxes, Kessler said. Under the GOP tax code, those deductions would be eliminated.

Don’t miss: Courts use Facebook to serve subpoenas and divorce papers

There are still some financial benefits that will remain for divorced spouses. Upon retirement, a person can claim spousal Social Security benefits based on the earnings of an ex-spouse, provided that the couple was married for at least 10 years and the claimant remains unmarried. If one partner is expecting a massive payday or bonus from a business venture, the other spouse may want to wait until after that income has been earned to divorce. (Inheritance by one spouse is not regarded as community property.)

The tax code comes at a bad time for many Americans, especially those in the higher income bracket. Baby boomers accumulated more wealth over their lives and — for the most part — missed the worst parts of the Great Recession such as buying a home at the peak of the market. And they are also getting divorced in much higher numbers. The rate of divorce doubled among adults of that age group between 1990 and 2010 to one in four people, according to a study carried out by Susan Brown and I-Fen Lin at Bowling Green State University.