# Truncate Time

> Truncate a Unix timestamp to a given period.

- ID: `truncate_time`
- Type: Block
- Category: [Time](https://inventor.bot/docs/reference/blocks/time.md)

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `unix_time` | yes | Unix timestamp to truncate. | e.g. `"1700000000"` |
| `period` | yes | Period to truncate to. | `"year"`, `"month"`, `"week"`, `"day"`, `"hour"`, `"minute"`, `"second"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `truncated_time_unix` | Truncated time in Unix seconds. | e.g. `"1700000000"` |

**Example**

```go
truncateTime := truncate_time(Args{unix_time: "1700000000", period: "hour"})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Truncated Time (Unix): " + truncateTime.truncated_time_unix,
})
```