How to Get the Current Date and Time in ClickHouse
Last updated July 25, 2026 · By the SaturnSQL team
now() returns the current DateTime and today() the current Date; yesterday() also exists. Use toStartOfDay, toStartOfHour, and friends to truncate timestamps, and pass a timezone name to now() for zone-aware values.
now() returns a DateTime with second precision; use now64() when you need milliseconds. today() and yesterday() return Date values, which are cheaper to compare against a Date-typed partition key. The toStartOf family (toStartOfDay, toStartOfHour, toStartOfMonth) is how you bucket timestamps for time-series grouping.
SELECT now(), today(), yesterday(), toStartOfDay(now());Timezones
ClickHouse stores DateTime as a UTC instant and applies a timezone only when rendering it. Passing a timezone name changes the zone used for that conversion, so toDate(now(), 'America/New_York') can return a different day than toDate(now()). Set the session default with SET timezone = 'Europe/Helsinki' if every query needs the same zone.
SELECT now('Europe/Helsinki'), toDate(now(), 'America/New_York');Run this in SaturnSQL
SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.
Try it free