-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework, Querying
-
None
-
Fully Compatible
-
Query 2017-07-31
The $dateToString operator is extended with the timezone argument. Its full new syntax is now:
{ $dateToString: { format: formatString, date: dateExpression, timezone: timeZoneIdentifier } }
The timezone argument is optional. The "timezone" argument is optional, and must evaluate to specify an Olson Timezone Identifier such as "Europe/London" or "America/New_York", or, a UTC offset string in the forms: "+03", "-0530", and "+04:45". If present, it formats the string according to the given time zone, otherwise it uses UTC.
The $dateToString format arguments have also been expanded. With the addition of the timezone argument came the %z and %Z format specifiers:
%z
The +hhmm or -hhmm numeric timezone as a string (that is, the hour and minute offset from UTC). Example: ``+0445``, ``-0500``
%Z
The minutes offset from UTC as a number. Example (following the ``+0445`` and ``-0500`` from %z): ``+285``, ``-300``
- depends on
-
SERVER-28612 Expand timelib library to take a configuration for format specifiers
- Closed
- is related to
-
SERVER-76696 $dateToString aggregation with timezone outputs invalid ISO8601 string
- Closed