The last full declaration of war between two sovereign states which were both recognized by the United Nations was in 1980 when Iraq invaded Iran, sparking the Iran-Iraq War. This declaration of war included two parts, per the Hague Convention of 1907. First, there was a “previous and explicit warning,” and second, they notified neutral powers of “a state of war” without delay.
Yes there have been a lot of wars since then. But none since 1980 have met all the requirements for a full declaration of war. For instance, after fighting started on September 27th of 2020, Armenia and Azerbaijan notified neutral countries of a state of war, but they had not warned each other first, meaning it does not quite count.