# Fixing a topic timestamp change gone wrong?

**URL:** https://meta.discourse.org/t/fixing-a-topic-timestamp-change-gone-wrong/406330
**Category:** Support
**Created:** [June 28, 2026, 9:38pm UTC](https://meta.discourse.org/t/fixing-a-topic-timestamp-change-gone-wrong/406330 "2026-06-28T21:38:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![adamengst](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adamengst/32/116607_2.png) [@adamengst](https://meta.discourse.org/u/adamengst)
#### Post date: [June 28, 2026, 9:38pm UTC](https://meta.discourse.org/t/fixing-a-topic-timestamp-change-gone-wrong/406330/1 "2026-06-28T21:38:12Z")

</div>

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?

> **[Sweet 1600 Star Posts (2026)](https://forum.fingerlakesrunners.org/t/sweet-1600-star-posts-2026/9848)**
>
> Use this topic for posts that will collect community stars for the Sweet 1600 course. You can also ask questions or make comments about this course. Here’s how it works. Click the “Post Using This Template” button below to create a new post...

Thanks!

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [June 28, 2026, 9:57pm UTC](https://meta.discourse.org/t/fixing-a-topic-timestamp-change-gone-wrong/406330/2 "2026-06-28T21:57:17Z")

</div>

I think this should still work:

> [@Editing post date?](https://meta.discourse.org/t/editing-post-date/19506/5):
>
> Here’s how to do it via the command line # ssh into your server cd /var/discourse # or /var/docker on pre-V1 install ./launcher enter app rails c post = Post.find\_by(id: 1234) post.created\_at = DateTime.new(2001,2,3,0,0,42) # year, month, day, hour, minute, seconds post.save

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

> [@Editing post date?](https://meta.discourse.org/t/editing-post-date/19506/16?silent=true):
>
> By the way, you can also find the post by the topic id and post number which are perhaps easier to read from the forum via the share link instead of inspecting source: Post.find\_by(topic\_id: 123, post\_number: 45)

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

---

<div class="post-metadata">

### Author: ![adamengst](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adamengst/32/116607_2.png) [@adamengst](https://meta.discourse.org/u/adamengst)
#### Post date: [June 28, 2026, 10:00pm UTC](https://meta.discourse.org/t/fixing-a-topic-timestamp-change-gone-wrong/406330/3 "2026-06-28T22:00:32Z")

</div>

Thanks! I’ll give it a try.

---

<div class="post-metadata">

### Author: ![adamengst](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adamengst/32/116607_2.png) [@adamengst](https://meta.discourse.org/u/adamengst)
#### Post date: [July 3, 2026, 11:40pm UTC](https://meta.discourse.org/t/fixing-a-topic-timestamp-change-gone-wrong/406330/4 "2026-07-03T23:40:02Z")

</div>

That worked, and since I had 24 posts to fix, I spent some time with Claude to build a Ruby script that would do it. And it was able to scan my email and other files to find the correct timestamps. The overall process wasn’t quick, but it was much less tedious than laboriously figuring out and copying and pasting timestamps.

Thanks!
