0

I'm curious what the trailing numbers after a timestamp represent. In some of my records, timestamps appear as I'm used to seeing them, as so:

2012-04-27 11:12:00

However, in other areas, timestamps appear like this:

2013-06-18 15:20:21.109533

Unfortunately, this breaks the search by date functionality I've built in to the application. Can anyone explain what the significance of the trailing numbers and period (shown below) are, and how to deal with them when I am searching by dates using the initial timestamp format? The records with the trailing numbers simply aren't included in the search, and I would like to normalize them, or search both types.

Interestingly enough, new records that are created have the trailing numbers as well. This leads me to believe that it may be a version upgrade along the way when these numbers started?

Something else that makes the version upgrade explanation compelling is that in several records, the created_at timestamp is in the first format listed, and the updated_at timestamp is in the second.

.109533
4

1 回答 1

1

这些只是小数秒。如果您不想要它们(不明白为什么您不想要它们,但仍然如此) - 只需将您的数据类型更改为时间戳(0)。更好的是:timestamptz(0)。

于 2013-06-18T15:53:36.777 回答