I know how to calculate difficulty, and I know it is increased or decreased by checking the timespan of the past 2016 blocks.
and I found actual code for calculating timespan: https://github.com/bitcoin/bitcoin/blob/master/src/pow.cpp#L55
actual_timespan = last_block->get_timestamp() - first_block->get_timestamp()
But, as I know timestamp in block is not the exact time of the mining: https://en.bitcoin.it/wiki/Block_timestamp
So, the timespan which is used to calculate the next difficulty is not the exact timespan but approximate value. Am I right?