Browse Source

fix(nocodb): add the timezone info for sqlite

pull/5659/head
Wing-Kam Wong 2 years ago
parent
commit
6a34d370a4
  1. 4
      packages/nocodb/src/models/Model.ts

4
packages/nocodb/src/models/Model.ts

@ -491,8 +491,8 @@ export default class Model implements TableType {
dayjs(val).utc().format('YYYY-MM-DD HH:mm:ss'), dayjs(val).utc().format('YYYY-MM-DD HH:mm:ss'),
]); ]);
} else if (isSqlite) { } else if (isSqlite) {
// e.g. 2022-01-01T10:00:00.000Z -> 2022-01-01 10:00:00 // e.g. 2022-01-01T10:00:00.000Z -> 2022-01-01 04:30:00+00:00
val = dayjs(val).utc().format('YYYY-MM-DD HH:mm:ss'); val = dayjs(val).utc().format('YYYY-MM-DD HH:mm:ssZ');
} else if (isPg) { } else if (isPg) {
// convert to local time // convert to local time
// e.g. 2023-01-01T12:00:00.000Z -> 2023-01-01 20:00:00+08:00 // e.g. 2023-01-01T12:00:00.000Z -> 2023-01-01 20:00:00+08:00

Loading…
Cancel
Save