---
source_url: https://www.pubnub.com/docs/sdks/lua/api-reference/misc
title: Miscellaneous API for Lua SDK
updated_at: 2026-06-23T11:45:09.707Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Miscellaneous API for Lua SDK

The methods on this page are utility methods that don't fit into other categories.

## Time

This function will return a 17 digit precision Unix epoch.

:::note Algorithm constructing the timetoken
```javascript
timetoken = (Unix epoch time in seconds) * 10000000
```
Example of creating a timetoken for a specific time and date:
```javascript
08/19/2013 @ 9:20pm in UTC = 1376961606
timetoken = 1376961606 * 10000000
timetoken = 13769616060000000
```
:::

### Method(s)

To fetch `Time` you can use the following method(s) in Lua SDK:

```lua
pubnub_obj:time(callback)
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| callback | function | Yes |  | Callback function to call with the received time (token). |

### Sample code

#### Get PubNub timetoken

```lua
pubnub_obj:time(function(t)
    textout("Got timetoken: " .. t)
end)
```