> ## Content Index
> Fetch the complete content index at: https://talkjs.com/resources/llms.txt
> Use this file to discover other available public pages before exploring further.

# Filter messages and conversations by creation time
- URL: https://talkjs.com/resources/filter-messages-and-conversations-by-creation-time/
- Published: 2023-10-16T10:30:00.000Z
- Updated: 2025-02-18T09:51:36.000Z
- Description: Do you need to get all messages that were sent before, after, or during a certain time? You can now filter both conversations and messages by their creation time.
- Author: Chris
- Tags: Product

Do you need to get all messages that were sent before today? Every message sent since 7:00 AM? Or all new conversations during the month of April?

You can now filter both conversations and messages by their creation time.

Using the `createdAt` property, you can select exactly those messages or conversations that were created before a certain time, after a certain time, or within a particular time interval.

`createdAt` must be a two-element array with an `[operator, operand]`\-structure. Valid operators are: `">"`, `"<"`, `">="`, `"<="`, `"between"`, and `"!between"`. The operand must be either a number or, when using either of the `"between"` and `"!between"` operators, a two-element array of numbers.

For example, to show only the conversations that have been created after the UNIX timestamp 1679298371586, you can use:

```js
{ createdAt: [">", 1679298371586] }

```

Read more on filtering [messages](https://talkjs.com/docs/Reference/JavaScript%5FChat%5FSDK/Other%5Finterfaces/#MessagePredicate) and [conversations](https://talkjs.com/docs/Reference/JavaScript%5FChat%5FSDK/Other%5Finterfaces/#ConversationPredicate%5F%5FcreatedAt) by their creation time.