I originally closevoted with a comment saying the general trend is to move from two separate words, through the hyphenated form to a single-word form. But actually it's a bit more complex than that. Compare this NGram for what I would call a "compound noun" usage at nighttime...
...with the more obviously "compound adjective" usage a nighttime [some modified noun]...
What you see at first glance is that the "noun" usage has declined overall (we've increasingly tended to discard the word time in constructions like "Dracula visited her at night[time]"). On the other hand, we've become increasingly fond of the compound adjectival form.
But if you look more closely, you'll notice that although the single-word form has become the most common in both contexts, there's been a significant shift in relative preferences for the other two forms. As a "noun", the double-word form is now slightly preferred over the hyphenated one, but as an "adjective" the opposite preference is now quite marked.
In light of that I think I should qualify my original comment. The general tendency is indeed to discard the hyphen - but whereas "compound adjective" usages invariably replace it with a single-word form, in other contexts we're quite likely to revert to a two-word form.
This same distinction can be seen if we compare adjectival fleabitten (where the hyphenated form continues to dominate) with the noun fleabite (where the two-word form is now preferred).
I think what this means is that writers in general increasingly reject "indiscriminate" use of hyphenated forms (just as we no longer indulge in the indiscriminate capitalisation of C19 and earlier). But hyphenated compound adjectives are more resistant to this shift than other usages. Because we don't like two-word compound adjectival forms at all, we keep the hyphen unless the single-word form is both familiar (to the ear) and easy to parse (for the eye).