internalsGet Pro

Module 02 · Lesson 6 of 12Pro

Dates, times and time zones in SQL

Level
Intermediate
Topic
SQL for data engineering
Reading time
17 min

When you finish this page you can

  1. Store order times as TIMESTAMPTZ instants and turn them into Kartly’s IST business day explicitly, whatever the session time zone.
  2. Select a day or an hour with half-open ranges and date_trunc, so no row is counted twice or missed.
  3. Parse dd/mm/yyyy dates with an explicit format and catch the rows that don’t match.
  4. Handle EU customers’ local times with zone names, not fixed offsets, across daylight saving changes.
  1. Data sources: databases, events, files and APIs13 min
  2. Design: a first analytics pipeline for an online store30 min

Monday has two revenues

is an online store in India. Every night its data team loads the day’s orders from the store’s PostgreSQL database into an analytical database. Daniel, who leads finance reporting, reads yesterday’s revenue there at 07:00.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan