Now I of course don’t know the details of the production line, but a wild guess would be that they keep a stock of manufactured but not sealed phones.
So the iOS installation and boxing is a separate process to the actual assembly. The date is the assembly date.
Again, I’m not sure about this but I still find it highly unlikely that they do the effort of unboxing a factory sealed product at the store to just update.
It would take massive amounts of work to organise the stock, open, update, reseal, restock. All this when the end user can do the update themselves anyway.
I think they are not even allowed to open boxes at the store if it’s not during a sale.