|
|
@ -477,10 +477,13 @@ export default class Model implements TableType { |
|
|
|
.utcOffset(d.getTimezoneOffset(), true) |
|
|
|
.utcOffset(d.getTimezoneOffset(), true) |
|
|
|
.format('YYYY-MM-DD HH:mm:ss'); |
|
|
|
.format('YYYY-MM-DD HH:mm:ss'); |
|
|
|
} else if (isPg) { |
|
|
|
} else if (isPg) { |
|
|
|
val = dayjs |
|
|
|
if (col.dt !== 'timestamp with time zone') { |
|
|
|
.utc(val) |
|
|
|
// e.g. 2023-05-10T08:49:32.000Z -> 2023-05-10 08:49:32-08:00
|
|
|
|
.utcOffset(d.getTimezoneOffset(), true) |
|
|
|
val = dayjs |
|
|
|
.format('YYYY-MM-DD HH:mm:ssZ'); |
|
|
|
.utc(val) |
|
|
|
|
|
|
|
.utcOffset(d.getTimezoneOffset(), true) |
|
|
|
|
|
|
|
.format('YYYY-MM-DD HH:mm:ssZ'); |
|
|
|
|
|
|
|
} |
|
|
|
} else if (isMssql) { |
|
|
|
} else if (isMssql) { |
|
|
|
val = dayjs |
|
|
|
val = dayjs |
|
|
|
.utc(val) |
|
|
|
.utc(val) |
|
|
@ -492,6 +495,9 @@ export default class Model implements TableType { |
|
|
|
if (isMySQL) { |
|
|
|
if (isMySQL) { |
|
|
|
// convert to utc
|
|
|
|
// convert to utc
|
|
|
|
val = dayjs(val).utc().format('YYYY-MM-DD HH:mm:ss'); |
|
|
|
val = dayjs(val).utc().format('YYYY-MM-DD HH:mm:ss'); |
|
|
|
|
|
|
|
} else if (isPg) { |
|
|
|
|
|
|
|
// convert to utc
|
|
|
|
|
|
|
|
val = dayjs(val).utc().format('YYYY-MM-DD HH:mm:ssZ'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// keep it as it is
|
|
|
|
// keep it as it is
|
|
|
|
val = dayjs(val).format('YYYY-MM-DD HH:mm:ssZ'); |
|
|
|
val = dayjs(val).format('YYYY-MM-DD HH:mm:ssZ'); |
|
|
|