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

YouTube Video: GwCRcRa8f3A

Open House

Open House 2026: Day 1 Keynote

The latest ClickHouse announcements, featuring real-world use cases from Shopify, Zoox, Visa, and Cisco.

YouTube Video: ZtvlCz7Ukg4

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.

YouTube Video: FmS7VopaqNg

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.

Follow us

XBlueskySlackGithubTelegramMeetupRSS