diff --git a/ui/litellm-dashboard/src/components/view_logs/columns.tsx b/ui/litellm-dashboard/src/components/view_logs/columns.tsx index 8903f57cd96..3a55f517741 100644 --- a/ui/litellm-dashboard/src/components/view_logs/columns.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/columns.tsx @@ -5,6 +5,7 @@ import React from "react"; import { CountryCell } from "./country_cell"; import { getProviderLogoAndName } from "../provider_info_helpers"; import { Tooltip } from "antd"; +import { TimeCell } from "./time_cell"; export type LogEntry = { request_id: string; @@ -53,9 +54,7 @@ export const columns: ColumnDef[] = [ { header: "Time", accessorKey: "startTime", - cell: (info: any) => ( - {moment(info.getValue()).format("MMM DD HH:mm:ss")} - ), + cell: (info: any) => , }, { header: "Request ID", diff --git a/ui/litellm-dashboard/src/components/view_logs/time_cell.tsx b/ui/litellm-dashboard/src/components/view_logs/time_cell.tsx new file mode 100644 index 00000000000..5c0662adb48 --- /dev/null +++ b/ui/litellm-dashboard/src/components/view_logs/time_cell.tsx @@ -0,0 +1,38 @@ +import * as React from "react"; + +interface TimeCellProps { + utcTime: string; +} + +const getLocalTime = (utcTime: string): string => { + try { + const date = new Date(utcTime); + return date.toLocaleString('en-US', { + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hour12: true + }).replace(',', ''); + } catch (e) { + return "Error converting time"; + } +}; + +export const TimeCell: React.FC = ({ utcTime }) => { + return ( + + {getLocalTime(utcTime)} + + ); +}; + +export const getTimeZone = (): string => { + return Intl.DateTimeFormat().resolvedOptions().timeZone; +}; \ No newline at end of file