The phrase "When lilacs last in the dooryard bloom'd" is from a poem by Walt Whitman titled the same. The poem was written in the summer of 1865 as an elegy mourning the death of President Abraham Lincoln, who was assassinated on April 14, 1865. Whitman composed this poem during a period of national mourning and it reflects his grief and contemplation of death. The poem begins with the image of lilacs blooming in the dooryard in spring, which signifies a perennial, returning symbol of remembrance and mourning for Lincoln. The "last lilacs" implies the lilacs blooming in the dooryard during late spring, reflecting the time around Lincoln’s death in April 1865. Whitman connected the blooming of the lilacs with the memory of his loved one, using it as a symbol of life that continues amidst sorrow and loss.
In summary, the lilacs bloom in the dooryard in the spring, around the time Whitman wrote his elegy in 1865 following Lincoln’s assassination. The poem ties the blooming of lilacs to the cycle of remembrance and mourning.