Parsing dates and datetimes in ClickHouse
Mark Needham
Parsing dates and datetimes is one of those things you'll do constantly in ClickHouse, and there are actually quite a few different approaches depending on your data format. In this tutorial, we walk through five practical methods for handling everything from Unix timestamps to messy string formats that you might get from APIs or legacy systems.
- Converting Unix timestamps (seconds, milliseconds, and microseconds)
- Parsing numeric date formats from legacy databases and mainframes
- Handling datetime strings with known formats using MySQL and JODA syntax
- Using "best effort" parsing for inconsistent or unknown date formats
- Configuring session-level settings for automatic type casting can we make this to htnml
Recent videos
View all Videos
Open House
Open House 2026: Day 1 Keynote
The latest ClickHouse announcements, featuring real-world use cases from Shopify, Zoox, Visa, and Cisco.

Open House
Fireside Chat: The state of data and AI with Bret Taylor (Sierra) and Aaron Katz (ClickHouse)
Aaron Katz (CEO, ClickHouse) and Bret Taylor (Co-Founder Sierra, Chairman of the Board, OpenAI) have an open conversation on the state of AI.

Open House, ClickHouse
How to build a great database (Alexey Milovidov)
The principles behind building a great database, and the new frontiers shaping the field.

Open House
Fireside Chat: Ecosystem and technology trends (Vercel, dbt Labs, CoreWeave)
Aaron Katz (CEO, ClickHouse), Guillermo Rauch (CEO, Vercel), Tristan Handy (CEO, dbt Labs), and Lukas Biewald (SVP of AI, CoreWeave) discuss how AI is changing the data landscape.