* Tech stocks eye worst day in nearly a month

* Energy stocks set for best day in nearly six weeks

* Mining stocks hit highest since Jan. 8

* NZ set for fourth straight session of losses

Feb 23 (Reuters) - Australian shares traded little changed on Tuesday as gains in miners and energy firms on stronger commodity prices countered losses in tech stocks following a weak lead from U.S. peers.

The S&P/ASX 200 index was nearly unchanged at 6,779.5 by 0000 GMT, after swinging between positive and negative territory for much of the early part of the session.

Tech stocks were the biggest drags on the benchmark, tracking losses in U.S. peers that have come under pressure from an uptick in bond yields and concerns over higher inflation affecting valuations.

"Steadily rising real yields should reflect better growth prospects for equities but if they rise suddenly, pushed higher by flows from rapid repositioning, then we think the impact of a higher discount rate will pull equities lower," analysts at UBS said in a note.

Buy-now-pay-later giant Afterpay shed 7.8% to lead losses among local tech companies which were set for their worst session since Jan. 28.

Investors will watch closely for any changes to the U.S. Federal Reserve's dovish outlook from Chairman Jerome Powell when he speaks before the Senate Banking Committee later in the day.

Energy stocks gained up to 4.1% and were on track to post their best session since Jan. 13, lifted by a jump in oil prices as investors anticipate a slow recovery in U.S. crude output following a cold snap in the state of Texas. Oil Search climbed 8.6% after posting a surprise underlying profit.

Newcrest Mining and AngloGold Ashanti led gains among gold miners, which climbed 5.6%, as worries over rising inflation and a weaker U.S. dollar pushed the metal higher.

Firmer bullion and copper prices supported a more than 1% rise in heavyweight miners, which hit their highest since Jan. 8. Copper prices breached the $9,000 mark for the first time since 2011 on indications of tight supply.

New Zealand's benchmark S&P/NZX 50 index declined 0.6% to 12,356.68 and was on track for a fourth straight session of falls. (Reporting by Arpit Nayak in Bengaluru; Editing by Subhranshu Sahu)