# TO\_TIMESTAMP

```
TO_TIMESTAMP(longExpr)
```

Converts a string representation of a date into epoch value using the pattern provided.

```
TO_TIMESTAMP (strExpr, pattern)
```

Converts a string using a pattern to a date and time type.

Available in:

| Processors | SQL Studio |
| ---------- | ---------- |
| ✓          | ✓          |

*Sample code:*

```sql
USE `kafka`;
SELECT 
    TO_TIMESTAMP(tpep_pickup_datetime),
    tpep_pickup_datetime 
FROM nyc-yellow-taxi-trip
LIMIT 1;
```

*Output:*

```json
{
  "value": {
    "TO_TIMESTAMP": "2016-01-01T00:00:02Z",
    "tpep_pickup_datetime": "2016-01-01 00:00:02"
  }
}
```
