If you don't know who the composer of a piece is (e.g if you're hearing it but not looking at the sheet music), there are still plenty of clues and tips you can use that can help you get an idea of when it was written and who might have written it. One dead giveaway that a piece is from the baroque era, for example, is if you can hear a harpsichord. Vice versa, if you hear a piano it's unlikely to be baroque because the piano wasn't invented until the late 18th century. Another thing that can help you tell whether a piece is baroque is listening for ornamentation. Baroque composers often expected their performers to improvise ornaments, but this fell out of fashion later on. The later you go in your music history, the more adventurous people are with harmony. If you can hear dissonant or clashing chords, that's likely to be romantic or 20th century. If it gets so clashy that you can't make out a key (atonal) then its definitely 20th century! Also, use of rubato (messing around with the tempo) and large orchestras are a good indication that a piece is from a later time period.