fix(timezone): use UTC for database storage and local time for UI display
Backend changes: - SQL Server dialect: GETDATE() → SYSUTCDATETIME() - MySQL dialect: NOW() → UTC_TIMESTAMP() - Ensures OperationTime and EndTime use consistent UTC timezone Frontend changes: - formatDateTime: display UTC timestamps in user's local timezone - Uses getFullYear/getMonth/getDate/getHours (local) instead of UTC methods Data migration: - Executed migration script to fix historical OperationTime records - All existing records now have correct UTC timestamps - Execution duration now accurate (minutes, not hours) Impact: - New executions store UTC timestamps correctly - UI displays times in user's local timezone (UTC+8 for CN users) - Historical data corrected via migration - Time difference between OperationTime and EndTime now accurate
This commit is contained in:
@@ -27,7 +27,7 @@ export class MySqlDialect implements SqlDialect {
|
||||
}
|
||||
|
||||
currentTimestamp(): string {
|
||||
return 'NOW()'
|
||||
return 'UTC_TIMESTAMP()'
|
||||
}
|
||||
|
||||
upsert(params: {
|
||||
|
||||
@@ -26,7 +26,7 @@ export class SqlServerDialect implements SqlDialect {
|
||||
}
|
||||
|
||||
currentTimestamp(): string {
|
||||
return 'GETDATE()'
|
||||
return 'SYSUTCDATETIME()'
|
||||
}
|
||||
|
||||
upsert(params: {
|
||||
|
||||
Reference in New Issue
Block a user