Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{{CURRENT_TIME}} is not shifting to local time in presentation - reporting UTC0. #3681

Closed
2 tasks
jason-e-gross opened this issue Jul 6, 2024 · 4 comments
Closed
2 tasks

Comments

@jason-e-gross
Copy link

jason-e-gross commented Jul 6, 2024

Bug Report

Description

Bug Summary:
Giving the prompt {{CURRENT_TIME}} is off by 5 hours, appears to be a bad timezone shift?

Steps to Reproduce:
Add CURRENT_TIME to the prompt, ask the model what time it is.

Expected Behavior:
For it to report the accurate time according to the machine it's on.

Actual Behavior:
The time is 5 hours in the future -- I suspect its a malformed timezone shifting.

Environment

  • Open WebUI Version: [e.g., 0.1.120]

  • Ollama (if applicable): [e.g., 0.1.30, 0.1.32-rc1]

  • Operating System: [e.g., Windows 10 for browser to openWebUI, ollama and openWebUI running on Ubuntu server -- all have the same time/date ]
    Confirmation:

  • [X ] I have read and followed all the instructions provided in the README.md.

  • [X ] I am on the latest version of both Open WebUI and Ollama.

  • I have included the browser console logs.

  • I have included the Docker container logs.

Logs and Screenshots

Screenshots (if applicable):
[Attach any relevant screenshots to help illustrate the issue]

The prompt.
image

It responding with an incorrect time.
image

Super blurry, but this is the machine webui and ollama are running on, same time/date.
image

Worth noting, I'm in CST - which happens to be -5 -- so this looks like it's not shifting the time to the local time, and using UTC0 time to report the time.

Seems like date/time should be shifted local, because asking it for something like hourly forecast is gonna be weird - and it doesn't feel very natural for a human having to do that work to talk to an AI?

Later edit: also worth noting, I asked it for the current time, but shift to CST - and it seems to think the time it reports (which is UTC0 is already shifted).

Later later edit:
I was able to get it to behave, of sorts, with this prompt

The current date and time is {{CURRENT_DATE}}. The current time is {{CURRENT_TIME}}, but subtract five hours from that time whenever you use or report it. Don't bother telling me you did the adjustment. You are a friendly and helpful assistant.

but, its still kinda braindead in terms of figuring things out, it has July 6/2024 right, but thinks its a Friday
image

ANOTHER EDIT
It appears to taking localized date format, and converting it wrong. Even though it's telling me correctly that today is July 06, 2024 - when I ask what day of the week that is, it's doing that work via "07-06-2024", European flavor -- (ie, reading it as 7th of June - and telling me its a Friday".

@jason-e-gross jason-e-gross changed the title {{CURRENT_TIME}} is not accurate. {{CURRENT_TIME}} is not shifting to local time in presentation - reporting UTC0. Jul 6, 2024
@jason-e-gross
Copy link
Author

jason-e-gross commented Jul 6, 2024

Funnily enough, I got it to behave by adjusting its prompt to this:

The current date and time is {{CURRENT_DATE}}.  
The current time is {{CURRENT_TIME}}, but subtract five hours from that time whenever you report it.
Don't bother telling me you did the adjustment.  
You are a friendly and helpful assistant.  

@justinh-rahb
Copy link
Collaborator

Another fix for this is to set the TZ environment variable on your Docker host, or the WebUI container.

@jason-e-gross
Copy link
Author

jason-e-gross commented Jul 6, 2024 via email

@jason-e-gross
Copy link
Author

jason-e-gross commented Jul 7, 2024

Another fix for this is to set the TZ environment variable on your Docker host, or the WebUI container.

Worked like a charm, that's the answer. Thanks @justinh-rahb .

For anyone else finding this and needing the answer directly - add -e Your/Timezone to your docker run command (or an arg/env in your compose file).

like:
docker run -d --network=host -v open-webui:/app/backend/data -e TZ=America/Chicago -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-web-ui --restart always ghcr.io/open-webui/open-webui:main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants