We know that Ambrose Bierce's short story, "An Occurrence at Owl Creek Bridge," takes place sometime after October 1862, since the Confederate defeat at the Battle of Corinth (October 3-4, 1862 in Corinth, Mississippi) is mentioned in Part II. Although no specific date is given in the story, it could take place as late as 1865, since the Yankee spy who entraps Peyton Farquhar tells him that
"The Yanks are repairing the railroads," said the man, "and are getting ready for another advance. They have reached the Owl Creek bridge, put it in order and built a stockade on the north bank."
There were few battles during the Civil War in Alabama, but an invasion of the state known as Wilson's Raid (led by Union cavalry General James Wilson) took place in March-April 1865 in the last months of the war. Confederate General Nathan Bedford Forrest's small command was unable to deter Wilson's much larger force.
In the short story, Farquhar is lured by a Union spy dressed as a Confederate soldier to burn the Owl Creek Bridge. He is caught in the act and is sentenced to hang from the same railroad bridge that he was attempting to destroy. The author uses the hanging to fool the reader into believing that Farquhar has miraculously escaped death: The hangman's rope breaks, Farquhar swims away and makes the long walk back to his plantation. Just as he is about to greet his wife, Bierce returns the reader to reality. Farquhar has not escaped after all: His escape has just been the final, fleeting moments of life leaving him--a wishful but hopeless scenario flashing before his eyes as he dangles from the Owl Creek Bridge.