Skip to main content

eval_datetime_function_with_clock

Function eval_datetime_function_with_clock 

Source
pub fn eval_datetime_function_with_clock(
    name: &str,
    args: &[Value],
    frozen_now: DateTime<Utc>,
) -> Result<Value>
Expand description

Evaluate a temporal function using a frozen statement clock.

Routes to the appropriate handler based on function name. Supports:

  • Basic constructors: DATE, TIME, DATETIME, LOCALDATETIME, LOCALTIME, DURATION
  • Extraction: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND
  • Dotted namespace functions: DATETIME.FROMEPOCH, DATE.TRUNCATE, etc.

For zero-arg temporal constructors (e.g. time(), datetime()), uses the provided frozen_now instead of calling Utc::now(). This ensures that all occurrences within the same statement return an identical value, as required by the OpenCypher specification.