Components were made as much as 6 months ago. Final assembly is done just 1or 2months Prior. But several prototype batches are made early on as well.
As a rule of thumb I just don’t buy Phones at Launch which are part of early Production runs. I’m getting ready for all the IPhone X “Gate” threads a few of which I can predict already are
#1. Does your iPhone have an Intel Radio or a Qualcomm Radio
#2. Does your iPhone X have low quality Hynix RAM or better quality Samsung RAM ?
A lot of these things won’t be know until early adopters aka Beta Testers iron these things out for us.