A petrol engine can fire the spark plugs slightly earlier or later to account for factors like revolution speed and engine temperature.
However a diesel only fires when the mixture is compressed. There are no spark plugs to say "burn... NOW"
I am aware that glow plugs are used to pre-heat the top of each diesel cylinder, but they're always warm and can't give an initial ignition to the mix.
So, How does a diesel engine not suffer from late ignition when cold, or preignition/pinking when hot?
This is a follow-on question to Why do Diesel engines have a higher compression ratio than gasoline engines?