---
source_url: https://www.pubnub.com/docs/sdks/rest-api/message-persistence-introduction
title: Message Persistence introduction
---

# Message Persistence introduction

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

Message Persistence allows you to store and retrieve messages. You can retrieve the following:

* [Messages](https://www.pubnub.com/docs/data-storage/message-history/overview.md)
* [Message actions](https://www.pubnub.com/docs/pub-sub/message-actions/overview.md)
* [File messages](https://www.pubnub.com/docs/data-storage/files/overview.md)

### Timetokens

The timetoken represents a 17-digit precision unix time (UTC). To convert PubNub's timetoken to Unix timestamp (seconds), divide the timetoken number by 10,000,000 (10^7).

To convert back and forth between current time, use [our converter](https://www.pubnub.com/docs/data-storage/message-history/overview.md) or check out the following Ruby example:

```ruby
> now = Time.now => 2012-11-02 14:27:11 -0700

> timetoken = now.to_f * 10000000 => 13518916319742640

> Time.at(timetoken / 10000000) => 2012-11-02 14:27:11 -0700
```

For more information, refer to [Message Persistence](https://www.pubnub.com/docs/data-storage/message-history/overview.md).
