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.
Attachments
For Gerrit Dashboard: MB-19773 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
67789,1 | MB-19773 Add optional timezone component to MILLIS_TO_STR date function | master | query | Status: ABANDONED | +1 | 0 |
67830,4 | MB-19773 Add optional timezone component to DATE_PART_MILLIS date function | master | query | Status: MERGED | +2 | +1 |
67832,1 | MB-19773 Add optional timezone component to DATE_PART_MILLIS date function | master | query | Status: ABANDONED | 0 | 0 |