Details
Description
Currently, the DATE_PART suite of functions always operate in the timezone of the Couchbase Server. This can cause inconsistent behavior, for example working on your local machine in your local timezone versus a production cluster running in UTC.
As an example:
SELECT DATE_PART_MILLIS(STR_TO_MILLIS('2016-05-15T00:00:00Z'), 'day')
Will return this result if the server is in UTC:
15
And this result if the server is in Eastern Daylight Time:
14
It would be helpful to have either a set alternative implementations (i.e. DATE_PART_UTC_MILLIS, etc) that always return the result based on UTC, or an optional parameter to the existing functions to specify the time zone.