Skip to content

Commit

Permalink
fix: brazilia timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
OtacilioN committed Sep 3, 2024
1 parent 09f13f1 commit 314274e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/processors/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const processAiRun = async ({

export const useAI = async (user: UserSchema, text: string) => {
const threadId = user?.threadId || (await createThread());
const systemClockMsg = `Relógio do Sistema: ${new Date().toLocaleString('pt-BR')}`;
const systemClock = new Date();
systemClock.setHours(systemClock.getHours() - 3); // Brasília time zone
const systemClockMsg = `Relógio do Sistema: ${systemClock.toLocaleString('pt-BR')}`;
await createMessage(threadId, systemClockMsg);
await createMessage(threadId, text);
const run = await runAssistant(threadId);
Expand Down

0 comments on commit 314274e

Please sign in to comment.