diff --git a/frontend/mining-app/lib/presentation/pages/profile/mining_records_page.dart b/frontend/mining-app/lib/presentation/pages/profile/mining_records_page.dart index 805cea6b..4dce17cf 100644 --- a/frontend/mining-app/lib/presentation/pages/profile/mining_records_page.dart +++ b/frontend/mining-app/lib/presentation/pages/profile/mining_records_page.dart @@ -298,7 +298,10 @@ class _MiningRecordsListPageState extends ConsumerState { // 去掉秒和毫秒部分,截短年份 final t = time.replaceAll('T', ' ').split('.').first; // 去毫秒 try { - final dt = DateTime.parse(t).toLocal(); + // distributionMinute 从后端返回的是 UTC 时间但不带 Z 后缀, + // DateTime.parse 不带 Z 会当作本地时间, 需要追加 Z 标记为 UTC + final utcStr = t.endsWith('Z') ? t : '${t}Z'; + final dt = DateTime.parse(utcStr).toLocal(); final y = (dt.year % 100).toString().padLeft(2, '0'); final m = dt.month.toString().padLeft(2, '0'); final d = dt.day.toString().padLeft(2, '0');