You can remember the meaning of 年代 with this easy mnemonic:
For the past year (年), she's been our substitute (代) teacher. That's quite a long period of time.
Using mnemonics to remember the meaning of Chinese characters like can have an enormous impact on how long to learn Mandarin it takes.