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