The AFI listed it among its "top 100" movie songs. National Public Radio included it in its "NPR 100", a 1999 list of the most important American musical works of the 20th century as compiled by NPR's music editors.[2] The song is a popular reflection of nostalgia and often used in films and series reflecting this feeling. [3][4]

Herman Hupfeld wrote "As Time Goes By" for the 1931 Broadway musicalEverybody's Welcome. In the original show, it was sung by Frances Williams. It was recorded that year by several artists, it was sung by Rudy Vallée and Binnie Hale, and orchestra recordings were made by Jacques Renard and Fred Rich. In terms of popularity at the time, it was a modest hit. Elisabeth Welch included it in her cabaret act as soon as it was released.

The song was re-introduced in 1942 in the film Casablanca. It was sung by Sam (Dooley Wilson); Sam's piano accompaniment was played by pianist Elliot Carpenter.[5] The song is heard throughout the film as a leitmotif.[6] Wilson was unable to record his version of the song at the time due to the 1942–44 musicians' strike, so Brunswick reissued the Jacques Renard 1931 recording, and RCA Victor re-issued Vallée's 1931 recording, giving Vallée a number-one hit in 1942.[7][8]

Hupfeld lived his whole life in Montclair, New Jersey, and was a regular customer at the Robin Hood Inn, a tavern built in 1922 on Valley Road, then part of Upper Montclair. He spent many hours at the piano and wrote several of his songs in this tavern, now the Valley Regency. A plaque on the second floor of the Valley Regency Catering Facility in Clifton, New Jersey, commemorates the song. He wrote over one hundred songs, including "Let's Put Out the Lights and Go to Sleep," and the popular Great Depression song "Are You Making Any Money?"[9]

The original song in the film as sung and played by "Sam" was recorded in D-flat major, but it has since been played in several keys, commonly C major, but also B-flat major, as in Frank Sinatra's recording, and other keys including A major and E-flat major, the key in which the song was originally published.

In Casablanca, Wilson sings the chorus ("You must remember this..."), but does not sing the verse ("This day and age we're living in..."). The omitted lines refer to Albert Einstein.[10][11][12][13]