Richard Taruskin, in his Oxford History of Western Music, describes Giuseppe Verdi's early career in the 1830s and 40s Italy as one marked by intense pressure and strict adherence to the conventions of opera composition, known as the "Code Rossini."
During this period, Verdi worked as a contract composer, juggling commissions and constantly revising his work under tight deadlines. He viewed these years, from the start of his career in 1836 with Oberto, conte di San Bonifacio to the premiere of La Traviata in 1853, as a gruelling experience akin to the labour of ancient Roman galley slaves.
In these challenging conditions, Giuseppe Verdi began his second opera, Un giorno di regno, under a direct commission from Bartolomeo Merelli, the impresario of Teatro alla Scala in Milan.
Merelli, impressed by Verdi's debut opera Oberto, saw his potential and signed a contract requiring Verdi to produce three more operas for La Scala to meet the theatre's demand for new works.
From the outset, Verdi felt more at home in serious, historical subject matter, and he initially agreed with the impresario that he would prepare a serious melodramma for him. Soon afterwards, however, it turned out that a light comedy would be more useful to Merelli for programming the season--and he charged his newly acquired associate with the task. Un giorno di regno, which turned out to be Verdi's only work fully belonging to the comic opera genre, was written in haste.
In many Verdi biographies, Un giorno is entirely passed over, or at most found in a chronology at the back. The premiere was given on 5 September 1840. The audience whistled its disapproval and openly mocked the work during its performance; the critics mostly tore it to shreds. Un giorno was taken from the bill immediately after that catastrophic premiere. Many years later, Verdi judged that the flop was due as much to the mercilessly criticised music as to the extremely weak performance.