“By the end of the year” in Chinese is 年前 (niánqián).
我三年前见过他。
I saw him three years ago.
Example sentence from Tatoeba (CC BY 2.0).