There is no easy way but you could try:
- fetch current head block and check it’s date
- with a date library calculate the difference in seconds between the target date and the head block date
- divide that number by 3 (we generate a block every 3 seconds)
- take the head block number minus the that needs number
- that’s your block
But since there have been blockchain crashes, if it doesn’t work then keep repeating