I've seen how nodes gather network time data, but how is it enforced in the blockchain?
Each node checks the timestamp of the block before forwarding it to any peers:
https://en.bitcoin.it/wiki/Block_timestampA 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
If the timestamp is found to be invalid, then the block is invalid and is not relayed to any peers.