# Private message time messed up

**URL:** https://meta.discourse.org/t/private-message-time-messed-up/73906
**Category:** Support
**Created:** [2017年十一月11日 19:17 UTC](https://meta.discourse.org/t/private-message-time-messed-up/73906 "2017-11-11T19:17:41Z")
**Posts on this page:** 7
**Page:** 2

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [2017年十一月12日 05:16 UTC](https://meta.discourse.org/t/private-message-time-messed-up/73906/21 "2017-11-12T05:16:36Z")

</div>

Does it jive with this?

[https://sinfulforums.net/t/test-topic-title/141.json](https://sinfulforums.net/t/test-topic-title/141.json)

```plaintext
[{"id":526,
"name":"Lunorian","username":"lunorian",
"avatar_template":"/user_avatar/sinfulforums.net/lunorian/{size}/3_1.png",
"created_at":"2017-11-11T21:09:26.238Z",
"cooked":"\u003cp\u003etest text goes here we are just testing\u003c/p\u003e",
"post_number":1,"post_type":1,
"updated_at":"2017-11-11T21:09:26.238Z","reply_count":0,

```

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [2017年十一月12日 05:31 UTC](https://meta.discourse.org/t/private-message-time-messed-up/73906/22 "2017-11-12T05:31:51Z")

</div>

When you posted, it should be around 11pm EST (what are you doing anyway up close to midnight on Saturday night?) 🤔

That means it would have been around 4am UTC.

The database record shows that it is `created_at` is 9pm UTC, which is obviously not correct. Therefore your problem came about at the time the database record is created.

EDIT: There is a difference of 7 hours, which if you wind your browser BACKWARDS by 7hr, it brings you EXACTLY to the date line. I suspect some time zone mistake.

EDIT 2: Notice that the UTC timestamp is Nov 11, not Nov 12. Which means that it is going BACKWARDS 7 hr.

---

<div class="post-metadata">

### Author: ![nsuchy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nsuchy/32/166530_2.png) [@nsuchy](https://meta.discourse.org/u/nsuchy)
#### Post date: [2017年十一月12日 17:37 UTC](https://meta.discourse.org/t/private-message-time-messed-up/73906/23 "2017-11-12T17:37:39Z")

</div>

So server time isn’t the issue, Discourse time is, where is Discourse getting the time from and how can this be corrected?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [2017年十一月12日 18:14 UTC](https://meta.discourse.org/t/private-message-time-messed-up/73906/24 "2017-11-12T18:14:13Z")

</div>

> [@nsuchy](#):
>
> where is Discourse getting the time from

AFAIK, Discourse uses Ruby `Time`, the default is

> <https://github.com/discourse/discourse/blob/main/config/application.rb#L109-L111>

Did you change that?

I’m in the Eastern timezone, and when I go to this site I see a difference of 7 hours for the UTC time  
[https://www.timeanddate.com/worldclock/timezone/utc](https://www.timeanddate.com/worldclock/timezone/utc)

It looks like if I were to somehow pass my local time as the create time it would become “7 hours ago”

Are you posting through the UI or through the API or email?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2017年十一月12日 21:05 UTC](https://meta.discourse.org/t/private-message-time-messed-up/73906/25 "2017-11-12T21:05:13Z")

</div>

The database record is incorrect, so there’s an issue when it’s saving the record.

What do these commands return?

```plaintext
$ date
$ date -u
$ readlink /etc/localtime

```

Along with the time on your machine when running that.

---

<div class="post-metadata">

### Author: ![nsuchy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nsuchy/32/166530_2.png) [@nsuchy](https://meta.discourse.org/u/nsuchy)
#### Post date: [2017年十一月13日 02:51 UTC](https://meta.discourse.org/t/private-message-time-messed-up/73906/26 "2017-11-13T02:51:52Z")

</div>

So apparently time was going away haywire due to NTP Sync and the DDoS Protection. A work-around is in place and the issue is resolved.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017年十一月13日 03:28 UTC](https://meta.discourse.org/t/private-message-time-messed-up/73906/27 "2017-11-13T03:28:45Z")

</div>



[上一頁](https://meta.discourse.org/t/private-message-time-messed-up/73906.md?page=1)
