# CONVERT\_DATETIME

```
CONVERT_DATETIME (strExpr, fromPattern, toPattern)
```

Converts the string format of a date \[and time] to another using the pattern provided.

Available in:

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

*Sample code:*

{% code fullWidth="false" %}

```sql
USE `kafka`;
SELECT 
 CONVERT_DATETIME(tpep_pickup_datetime, 'yyyy-MM-dd HH:mm:ss', 'dd-MM-yyyy HH:mm'), 
 tpep_pickup_datetime 
FROM nyc-yellow-taxi-trip
LIMIT 1;
```

{% endcode %}

*Output:*

```json
{
  "value": {
    "CONVERT_DATETIME": "01-01-2016 00:00",
    "tpep_pickup_datetime": "2016-01-01 00:00:02"
  }
}
```
