89799969 opened a new pull request, #4235:
URL: https://github.com/apache/rocketmq-dashboard/pull/4235
Fixes #4234.
## Problem / Evidence
Studio user management renders session and account timestamps with \
ew Date(value).toLocaleString()\. AuthService stores those fields as
offset-less \LocalDateTime\ values from \Clock.systemUTC()\
(\AuthService.now()\ → \ZoneOffset.UTC\ for \last_seen_at\, \expires_at\,
\password_changed_at\). JavaScript therefore treats them as browser-local
wall-clock times.
Local reproduction (TZ \Asia/Shanghai\, UTC+8):
\\\
new Date('2026-08-22T09:30:00').toLocaleString() → 2026/8/22 09:30:00
(wrong)
new Date('2026-08-22T09:30:00Z').toLocaleString() → 2026/8/22 17:30:00
(correct local)
\\\
Affected UI: user table columns 最近活跃 / 最近过期 / 创建时间, and the CSV export
columns (Last Session Seen At, Nearest Session Expires At, Password Changed At,
Created At, Modified At).
## Fix
Reuse the shared \ormatUtcDateTime\ helper (same approach as alert
\lastTriggered\ #4174/#4199 and query-history \queriedAt\ #4221/#4222), which
appends \Z\ for offset-less values before formatting into the viewer's timezone.
## Tests
\
px vitest run src/pages/studio/__tests__/UserManagement.test.tsx\ — **7
passed** (6 pre-existing + 1 new named regression \ reats offset-less session
timestamps as UTC\; existing session-metadata assertion updated to the UTC
helper).
Red light before the fix: the new/updated assertions expect \
ormatUtcDateTime('2026-08-22T09:30:00')\ (17:30 CST here); the old helper
rendered 09:30.
ESLint and Prettier clean on both changed files. Diff: 2 files, +14/−2.
## Risk
Low. Normal browsers already receive offset-less UTC wall-clock strings;
only the display/export conversion changes. Response shapes and backend fields
are unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]