# Parse Date and Time

> Parse a date and time into a Unix timestamp with a variety of parsing options.

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

> If both date and time are requested, they must be provided in the order of date then time, and be separated by a space.

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `input_datetime` | yes | User-provided date and/or time to parse. | e.g. `"12/10/2025 15:04"` |
| `date_format` | yes | Expected date format. | `"MM/DD/YYYY"`, `"DD/MM/YYYY"`, `"YYYY/MM/DD"` |
| `time_format` | yes | Expected time format. | `"HH:MM:SS"`, `"HH:MM"`, `"HH:MM:SS AM/PM"`, `"HH:MM AM/PM"` |
| `standardized_format` |  | If set, the date/time format will be ignored and the standardized format will be used. | `"RFC 3339"`, `"ANSIC"`, `"Unix Date"`, `"Ruby Date"`, `"RFC 822"`, `"RFC 822Z"`, `"RFC 850"`, `"RFC 1123"`, `"RFC 1123Z"`, `"RFC 3339Nano"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `parsed_time_unix` | Parsed time in Unix seconds. | e.g. `"1700000000"` |

**Example**

```go
parseDatetime := parse_datetime(Args{
	input_datetime: "12/10/2025 15:04",
	date_format:    "MM/DD/YYYY",
	time_format:    "HH:MM",
})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Parsed Time (Unix): " + parseDatetime.parsed_time_unix,
})
```