mirror of
https://github.com/lingble/clickhouse.git
synced 2025-11-21 21:34:51 +00:00
Fix save dates before 2002 year on DateTime fields
Issue https://github.com/TimonKK/clickhouse/issues/65
This commit is contained in:
2
index.js
2
index.js
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user