diff --git a/apps/deploy-web/src/components/billing-usage/BillingView/BillingView.spec.tsx b/apps/deploy-web/src/components/billing-usage/BillingView/BillingView.spec.tsx index 66eed0f49d..8261c659da 100644 --- a/apps/deploy-web/src/components/billing-usage/BillingView/BillingView.spec.tsx +++ b/apps/deploy-web/src/components/billing-usage/BillingView/BillingView.spec.tsx @@ -30,13 +30,13 @@ describe(BillingView.name, () => { it("renders table with billing data", () => { const { data } = setup(); expect(screen.getByText("History")).toBeInTheDocument(); - expect(screen.getByText("Date")).toBeInTheDocument(); + expect(screen.getByText("Date (UTC)")).toBeInTheDocument(); expect(screen.getByText("Amount")).toBeInTheDocument(); expect(screen.getByText("Account source")).toBeInTheDocument(); expect(screen.getByText("Status")).toBeInTheDocument(); expect(screen.getByText("Receipt")).toBeInTheDocument(); - expect(screen.getByText(new Date(data[0].created * 1000).toLocaleDateString())).toBeInTheDocument(); + expect(screen.getByText(new Date(data[0].created * 1000).toLocaleDateString(undefined, { timeZone: "UTC" }))).toBeInTheDocument(); expect(screen.getByText((data[0].amount / 100).toFixed(2))).toBeInTheDocument(); expect(screen.getByText(new RegExp(data[0].paymentMethod.card?.last4 || ""))).toBeInTheDocument(); expect(screen.getByText(/Succeeded|Pending|Failed/i)).toBeInTheDocument(); diff --git a/apps/deploy-web/src/components/billing-usage/BillingView/BillingView.tsx b/apps/deploy-web/src/components/billing-usage/BillingView/BillingView.tsx index 72dcbfa8ae..5a60d84b55 100644 --- a/apps/deploy-web/src/components/billing-usage/BillingView/BillingView.tsx +++ b/apps/deploy-web/src/components/billing-usage/BillingView/BillingView.tsx @@ -76,8 +76,10 @@ export const BillingView: React.FC = ({ const columns = [ columnHelper.accessor("created", { - header: "Date", - cell: info => new Date(info.getValue() * 1000).toLocaleDateString() + header: "Date (UTC)", + // Render in UTC so the displayed day matches the Stripe charge timestamp + // regardless of the viewer's local timezone (see akash-network/console#2010). + cell: info => new Date(info.getValue() * 1000).toLocaleDateString(undefined, { timeZone: "UTC" }) }), columnHelper.accessor("amount", { header: "Amount",