It is neither of those, although it is closer to the first. The second makes no sense. A block is not validated once at a specific time, it is validated thousands of times at thousands of different places. No one cares at what time someone else validated a block, because everyone must validate the block for themselves.
It is a number chosen by the miner. They can choose any value that is likely to be accepted by other nodes at the time those other nodes first receive the new block. The rule is:
A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours. "Network-adjusted time" is the median of the timestamps returned by all nodes connected to you.
Since it is part of the block header that is included in the data hashed, it cannot be altered.
As it has one second resolution there are probably of the order of ten thousand values that other nodes would accept.
See Can a miner set the EXACT timestamp of a block?