From a2ad7eb8cb2236f5ac60daad99a50651a78f4157 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 1 Feb 2025 16:21:45 -0800 Subject: [PATCH] ui use UTC for filtering time --- ui/litellm-dashboard/src/components/view_logs/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/litellm-dashboard/src/components/view_logs/index.tsx b/ui/litellm-dashboard/src/components/view_logs/index.tsx index 1d97a8e7e24..b4691fd3c4b 100644 --- a/ui/litellm-dashboard/src/components/view_logs/index.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/index.tsx @@ -105,10 +105,11 @@ export default function SpendLogsTable({ }; } - const formattedStartTime = moment(startTime).format("YYYY-MM-DD HH:mm:ss"); + // Convert times to UTC before formatting + const formattedStartTime = moment(startTime).utc().format("YYYY-MM-DD HH:mm:ss"); const formattedEndTime = isCustomDate - ? moment(endTime).format("YYYY-MM-DD HH:mm:ss") - : moment().format("YYYY-MM-DD HH:mm:ss"); + ? moment(endTime).utc().format("YYYY-MM-DD HH:mm:ss") + : moment().utc().format("YYYY-MM-DD HH:mm:ss"); return await uiSpendLogsCall( accessToken,