How to get the time when a block is received at a node? Is there any variable in the bitcoind code that records the timestamp when a block is received for the first time by a particular node? To be more precise, for transactions, transaction information returned by Bitcoind JSON RPC API contains timereceived. Is there similar field for blocks in the API?

There happens to be similar existing questions in stackexchange but none of them has been appropriately answered.
I don't believe this is exposed via the JSON-RPC API.

The easiest method would likely be to have a program monitoring debug.log and look for the best height update messages - they will be a few milliseconds off, since I believe those are only logged after block validation has succeeded, but it is likely the closest you can get to a per-node block receipt time, at least without monitoring the network traffic.