The first mention of Daffydowndilly was in the title of a novel by Nathaniel Hawthorne in 1843 called “Little Daffydowndilly”.
It is not known when the rhyme was first sung but one slightly modified version (the petticoat is fine, not yellow) in The Little Mother Goose (1912). Geographically, it is very likely that it originated in the United States (given that Hawthorne was born in Massachusets).
Has come to town
With a yellow petticoat
And a pretty green gown.