Fixing a topic timestamp change gone wrong?

I have a topic where the post date matters for an external system (it’s a leaderboard that looks for posts by people who ran a certain course on the same day). I mistakenly thought I could redate a post within the topic and ended up changing the topic’s date from April 17 to June 19. I did this on June 26, one week later. When I realized what I’d done and reset the topic date back to April 17, nearly all the posts ended up being given a date of April 24, presumably because Discourse tried to give them dates relative to June 19 and ran out of dates after June 26 (because they would have been in the future). And setting the date back to April 17 gave them relative dates one week later, or April 24.

Is there any way I can manually fix the dates on the interim posts?

Thanks!

I think this should still work:

This might be helpful too, because finding the post ID is more difficult than the topic ID and post number:

As always when using the Rails console: it’s a good idea to make a backup first, just to be safe.

Thanks! I’ll give it a try.