Probably since before recorded history, to be honest. I find it hard to believe that, for example, the Sumerians had no rules of war in place to affect a temporary truce to deal with the dead and wounded.
The earliest example I can think of that is well substantiated is ancient Greece, where truces often occurred to bury and/or return the dead or to exchange prisoners. Also during Greek games people (usually) put aside their differences until after everything was over, much like the modern Olympics.
Like modern times, such truces were not always heeded by both sides.
Sources:
On a personal note, I would like to see if someone with a knowledge of ancient India could chime in on this subject. I have recently started reading a bit about early Hindu warfare science, and would love to know how the idea of niti applies to truces such as the OP has mentioned.