Skip to main content

Function

Tool identifier datetime. datetime provides timezone-aware date and time operations: getting the current time, parsing common date/time strings, formatting output, converting between timezones, computing the difference between two timestamps, and adding or subtracting durations. All computation is local and accesses no external services. Import path: from veadk.tools.builtin_tools.datetime_tool import datetime

Prerequisites

Environment variables:
  • MODEL_AGENT_API_KEY: API key for the agent’s reasoning model (the datetime tool itself needs no extra credentials and accesses no external services)

Usage

examples/tools/datetime/agent.py
Direct calls for each action:

Parameters

Action behavior and returned fields: Success returns a dictionary with the fields above; invalid parameters return {"error": ...}.

Notes

  • ISO 8601 strings are supported (including the trailing Z or z UTC notation), along with YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, YYYY/MM/DD, and YYYY/MM/DD HH:MM:SS.
  • timestamp is Unix time in seconds; weekday ranges from monday to sunday; for diff, human gives a readable duration in days plus HH:MM:SS, with a minus sign when value2 is earlier than value.
  • Timezones use IANA names, so the runtime must provide the timezone database; containers or minimal systems lacking timezone data need the system tzdata package installed.
Last modified on November 20, 2026