Three O'Clock High (1987)
Three O'Clock High is a 1987 high-school comedy film, directed by Phil Joanou, written by Richard Christian Matheson and Thomas Szollosi; the executive producer was Aaron Spelling. The plot is loosely connected to the 1952 western classic, High Noon, wherein a town sherriff is forced into a showdown with a notorious criminal at a pre-arranged time: high school student (Casey Siemaszko) accidentally offends a bully (Richard Tyson) and devotes most of his school day to avoiding a fistfight with the bully at 3:00 p.m.
More at Wikipedia.