In The Giver, Jonas experiences war in Chapter 15. That entire chapter is devoted to an episode in which Jonas is given the memory of a war. The narrator does not tell us what war it is that Jonas is experiencing. Therefore, we need to turn to our knowledge of history to give us some hints.
First, we know that this is a war that is not, from our current perspective, modern. There are two or possibly three ways in which we can know that. First, we can infer it from the fact that there does not seem to be any efficiently organized care for the wounded. Jonas lies there for hours among people who are screaming in pain but who are apparently not being attended to. Second, Jonas’s uniform is made of “coarse cloth” which would not be the case today. Most importantly, we can tell this is an old war because of all the horses. Horses are clearly not a part of a modern war.
This leaves us wondering which early war we are talking about. It has lots of cannon and Jonas has a metal canteen. That implies it is not from all that long ago. The dying boy’s uniform is gray. To most Americans, a gray uniform in a pre-modern war means that it is the Civil War. Our image of the Confederate army is that it always wore gray. This is not 100% historically accurate, but it is what we tend to think.
So, Jonas is in a pre-modern war in which one side is wearing gray. To American readers, at least, that implies that it is the American Civil War.