verified in 5.5.0-2520 as per steps in the CBSE given
select DATE_TRUNC_STR("2017-01-01","month")
[
{
"$1": "2017-01-01"
}
]
select CLOCK_LOCAL() as local_time,
STR_TO_TZ("2017-01-01 00:00:00", 'UTC') utc_datetime,
DATE_TRUNC_STR("2017-01-01 00:00:00", "month") as test0,
DATE_TRUNC_STR("2017-01-01 16:00:00", "month") as test1,
DATE_TRUNC_STR("2017-01-01 15:59:59", "month") as test2,
DATE_TRUNC_STR("2017-01-01 00:00:00Z", "month") as test3,
DATE_TRUNC_STR("2017-01-01","month") as trunc_month,
DATE_TRUNC_STR("2006-01-01","year") as trunc_year
[
{
"local_time": "2018-04-17T15:53:55.516-07:00",
"test0": "2017-01-01 00:00:00",
"test1": "2017-01-01 00:00:00",
"test2": "2017-01-01 00:00:00",
"test3": null,
"trunc_month": "2017-01-01",
"trunc_year": "2006-01-01",
"utc_datetime": "2017-01-01 08:00:00"
}
]
Build couchbase-server-5.5.0-1839 contains query commit 3bdfa0a4ff3be0192b61f00a014b06fd28db0298 with commit message:
MB-27862Fix boundary condition behavior with DATE_TRUNC_STRhttps://github.com/couchbase/query/commit/3bdfa0a4ff3be0192b61f00a014b06fd28db0298