From From EIP 2, the Homestead difficulty adjustment algorithm is:
block_diff = parent_diff + parent_diff // 2048 * max(1 - (block_timestamp - parent_timestamp) // 10, -99) + int(2**((block.number // 100000) - 2))
where // is the integer division operator, eg. 6 // 2 = 3, 7 // 2 = 3, 8 // 2 = 4.
Due to differences in the clock settings on different miner's computers, can
block_timestamp be before
block_timestamp CANNOT be before
parent_timestamp, how are differences in the clock settings on different miner's computers taken into account?
EDIT June 12 2016 I've moved the second question above into How do Ethereum mining nodes maintain a time consistent with the network?
This question was prompted by the question How does the Ethereum Homestead difficulty adjustment algorithm work?, which was prompted by the question What was the first block mined with Homestead?
Other related Q&As: