possible solutions since i don't have a way to check it:
use getblockhash[1] command which will give you the has of the block header you want. you already know there are about 144 ( 24 hr * 60 min * 1 block /10 min) per day so get 144 block headers at first and then if you figured there were more within 24 hour then get 145th, 146th ,...
how you figure it out?
in each block header there is a field called block time[2] which is a unix timestamp which is set by the miner. it is most probably an accurate number but it doesn't have to. use this timestamp to figure out how many blocks were mined in a certain time frame.
[1]
https://bitcoin.org/en/developer-reference#getblockhash[2]
https://bitcoin.org/en/developer-reference#block-headers