Share feedback
Answers are generated based on the documentation.

Date and Time Tool

Obtain the current date, time, or datetime in a model-chosen format.

Overview

The datetime toolset exposes one read-only tool, get_datetime. It reads the current clock on each call and returns only the formatted string. No shell or external service is needed. It works in native and browser builds.

Configuration

agents:
  root:
    model: openai/gpt-5-mini
    instruction: Use get_datetime for the current date or time.
    toolsets:
      - type: datetime

No toolset-specific configuration is required. The model chooses the format and optional timezone in each tool call.

Tool arguments

ArgumentRequiredDescription
formatYesA Go time layout based on the reference time Mon Jan 2 15:04:05 MST 2006.
timezoneNoAn IANA timezone such as Europe/Paris, America/New_York, or UTC. Defaults to the host's local timezone; Local also selects it.

Choose a layout containing only the parts needed:

Desired outputformatExample result
Date2006-01-022026-10-07
Time15:04:0523:04:05
12-hour time3:04 PM11:04 PM
RFC3339 datetime2006-01-02T15:04:05Z07:002026-10-07T23:04:05Z
Long dateMonday, January 2, 2006Wednesday, October 7, 2026

For example:

{"format":"2006-01-02T15:04:05Z07:00","timezone":"UTC"}

The result is plain text, for example 2026-10-07T23:04:05Z, with no label or JSON wrapper.

Use Go layouts, not strftime directives (%Y-%m-%d) or tokens such as YYYY-MM-DD. Literal text in the layout is preserved. See the Go time layout documentation for more formats. Empty or whitespace-only formats and unknown timezones return tool errors.

The tool has no side effects and carries ReadOnlyHint. Approval still depends on the session's safety mode and permission rules.

See the example configuration.