c. 1300 (as two words from mid-12c., daies liht), from day + light (n.); its figurative sense of "clearly visible open space between two things" (1820) has been used in references to boats in a race, U.S. football running backs avoiding opposing tackles, a rider and a saddle, and the rim of a glass and the surface of the liquor. The (living) daylights that you beat out of someone were originally slang for "the eyes" (1752), extended figuratively to the vital senses.
[daylight etymology, daylight origin, 英语词源]