# uuid7_from_datetime

> **Function** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/uuid/uuid7_from_datetime)

Generate a UUID v7 from a datetime.

## Signature

```python
uuid7_from_datetime(
    dt: _dt.datetime,
) -> _uuid.UUID
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `dt` | `_dt.datetime` | Yes | A timezone-aware datetime. If naive, it is treated as UTC. |

## Returns

`_uuid.UUID`

uuid.UUID: A UUID v7 whose timestamp corresponds to the provided time.

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/ce9e9e8973442b33e98ec3ce1b9c2dd3f58a43a7/python/langsmith/uuid.py#L23)