# format_relative_timestamp

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/sessions/format_relative_timestamp)

Format ISO timestamp as relative time (e.g., '5m ago', '2h ago').

## Signature

```python
format_relative_timestamp(
    iso_timestamp: str | None,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `iso_timestamp` | `str \| None` | Yes | ISO 8601 timestamp string, or `None`. |

## Returns

`str`

Relative time string or empty string if invalid.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/a9e6e4f7ad7fe161dd9affc3d74bb19784aca70b/libs/cli/deepagents_cli/sessions.py#L151)