Fix save dates before 2002 year on DateTime fields

Issue https://github.com/TimonKK/clickhouse/issues/65
This commit is contained in:
tagplus5
2020-12-13 18:39:27 +02:00
committed by GitHub
parent 9dea3c0c3e
commit a8cb3b597d

View File

@@ -194,7 +194,7 @@ function encodeValue(quote, v, _format, isArray) {
// clickhouse allows to use unix timestamp in seconds // clickhouse allows to use unix timestamp in seconds
if (v instanceof Date) { if (v instanceof Date) {
return ("" + v.valueOf()).substr (0, 10); return Math.round(v.getTime() / 1000);
} }
// you can add array items // you can add array items