|
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``
|