Ray's Knowledge Base
Unlock

duql calendar time: one implementation in core, epoch-UTC ns units

DecisionVerified 2 Oct 2026Holds anywhere
Decision. The context, the choice, why, and the options that were turned down.

Context#

Implementing calendar/time functions for duql (E6).

Decision#

One calendar implementation in core/common/calendar.h (civil dates, ISO weeks, parts, strftime subset) shared by the duql row evaluator and dataframe temporal.cpp (duql cannot link dataframe; both link core). A time is v units of ns_per_unit since the Unix epoch, UTC, via 128-bit floor division (__extension__ __int128, user accepted for now).

Why#

duql cannot link dataframe, so the shared implementation must live in core.

Rejected options#

localtime; the call_column route.

Also found by searching

  • one calendar implementation in core/common/calendar.h
  • duql cannot link dataframe, both link core
  • a time is v units of ns_per_unit since the Unix epoch UTC
  • 128-bit floor division __int128 for calendar math