benasrau
@benasrau
·
a year ago
·
a year ago
Message Date And Time
Last Updated
a year ago
Created
a year ago
Function
filter
v0.1.1
Name
Message Date And Time
Downloads
1.2K+
Saves
8+
Description
Gives model current date and time context for each message. Don't forget to adjust the timezone in the settings.

Message Date and Time Context

Overview

This Open WebUI function automatically adds contextual date and time information to each message, providing the AI model with current temporal context.

Features

  • Adds system context message with current:
    • Day of the week
    • Date
    • Season
    • Time of day
    • Exact time
    • Timezone information

Configuration

You can configure the function using valves:

Timezone Settings

  • DATETIME_TIMEZONE_HOURS: Timezone offset hours (default: 0)
    • Positive for UTC+, Negative for UTC-
  • DATETIME_TIMEZONE_MINUTES: Timezone offset minutes (default: 0)
  • DATETIME_SOUTHERN_HEMISPHERE: Set to "true" if in Southern Hemisphere (default: "false")

Example Configuration

text
DATETIME_TIMEZONE_HOURS=5
DATETIME_TIMEZONE_MINUTES=30
DATETIME_SOUTHERN_HEMISPHERE=false

Supported Hemispheres

  • Automatically adjusts seasonal context based on hemisphere
  • Default is Northern Hemisphere
  • Can be changed by setting DATETIME_SOUTHERN_HEMISPHERE to "true"

Example Context Output

text
Current date is Friday, April 18, 2025, Spring, Morning, the user time is 10:30:45 UTC+5:30

Requirements

  • Open WebUI version: 0.6.4+

License

MIT License

Author

Benas Raudys (https://github.com/benasraudys)


1