[Studio][Bug] User management renders UTC session timestamps as browser-local time

Open Beginner friendly
#4,234 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java, typescript
Domain
frontend

Research direction

Start with UserManagement.tsx and the shared format.ts helper, then compare the alert and query-history fixes referenced in the issue. Trace the dateTime helper through the user-management table and CSV export; done means all listed timestamps render and export with the same UTC conversion and local display as those other pages.

Written by the indexing model from the issue text.

Description

Problem

The Studio user management page renders lastSessionSeenAt,
earestSessionExpiresAt, passwordChangedAt, gmtCreate, and gmtModified with
ew Date(value).toLocaleString(). Those values are offset-less \LocalDateTime\ strings. JavaScript therefore treats them as browser-local wall-clock times, so every viewer outside UTC sees session activity and password-change times shifted by their UTC offset.

Evidence

  • \AuthService.now()\ (\server/src/main/java/org/apache/rocketmq/studio/auth/AuthService.java) writes \LocalDateTime.ofInstant(Instant.ofEpochMilli(clock.millis()), ZoneOffset.UTC)\ into session \last_seen_at\ / \expires_at\ and user \password_changed_at. The clock is \Clock.systemUTC().
  • \StudioUserVO\ exposes those fields as \LocalDateTime\ (serialized without an offset).
  • \UserManagement.tsx\ helper: \const dateTime = (value?: string) => (value ? new Date(value).toLocaleString() : '-');\ used by the table columns 最近活跃 / 最近过期 / 创建时间 and by the CSV export columns.
  • Local reproduction (browser TZ \Asia/Shanghai, UTC+8):
    ew Date('2026-08-22T09:30:00').toLocaleString()\ → \2026/8/22 09:30:00\ (wrong; should be 17:30 local).
    ew Date('2026-08-22T09:30:00Z').toLocaleString()\ → \2026/8/22 17:30:00.

The same defect class was already fixed on other surfaces: alert \lastTriggered\ (#4174) and query-history \queriedAt\ (#4221 / #4222). The shared helper \ ormatUtcDateTime\ in \web/src/utils/format.ts\ already appends \Z\ for offset-less values; user management never adopted it.

Expected behavior

Render and export these timestamps with \ ormatUtcDateTime, matching the alert and query-history pages.

Related

#4174, #4221, #4222

Dominant language
Java
Stars
1.4k
Forks
692
Avg merge
2d 18h
Merged PRs (30d)
69

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/rocketmq-dashboard

All issues in apache/rocketmq-dashboard

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.