Skip to content

Commit 87def7f

Browse files
authored
DOCSP-33002 Mention %b and %B Specifiers in 7.0 RN (#5105) (#5123)
* DOCSP-33002 Mention %b and %B Specifiers in 7.0 RN * formatting * IF feedback * IF feedback * spelling
1 parent 52ade98 commit 87def7f

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

source/includes/extracts-date-format-specifiers.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ content: |
1313
- Possible Values
1414
1515
* - ``%b``
16-
- Abbreviated month (3 letters)
16+
- Abbreviated month name (3 letters)
17+
18+
.. versionadded:: 7.0
1719
- ``jan``-``dec``
1820
1921
* - ``%B``
2022
- Full month name
23+
24+
.. versionadded:: 7.0
2125
- ``january``-``december``
2226
2327
* - ``%d``

source/reference/operator/aggregation/dateToString.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ return the ``date`` field as formatted strings:
122122
timewithOffsetNY: { $dateToString: { format: "%H:%M:%S:%L%z", date: "$date", timezone: "America/New_York"} },
123123
timewithOffset430: { $dateToString: { format: "%H:%M:%S:%L%z", date: "$date", timezone: "+04:30" } },
124124
minutesOffsetNY: { $dateToString: { format: "%Z", date: "$date", timezone: "America/New_York" } },
125-
minutesOffset430: { $dateToString: { format: "%Z", date: "$date", timezone: "+04:30" } }
125+
minutesOffset430: { $dateToString: { format: "%Z", date: "$date", timezone: "+04:30" } },
126+
abbreviated_month: { $dateToString: {format: "%b", date: "$date", timezone: "+04:30" } },
127+
full_month: { $dateToString: { format: "%B", date: "$date", timezone: "+04:30" } }
126128
}
127129
}
128130
]
@@ -138,6 +140,8 @@ The operation returns the following result:
138140
"timewithOffsetNY" : "03:15:39:736-0500",
139141
"timewithOffset430" : "12:45:39:736+0430",
140142
"minutesOffsetNY" : "-300",
141-
"minutesOffset430" : "270"
143+
"minutesOffset430" : "270",
144+
"abbreviated_month": "Jan",
145+
"full_month": "January"
142146
}
143147

source/release-notes/7.0.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,28 @@ New operators:
378378
This operator can be used as an accumulator and as an aggregation
379379
expression.
380380

381+
Month Name Specifier for $dateToString
382+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
383+
384+
MongoDB 7.0 adds the following format specifiers to use with the
385+
:expression:`$dateToString` operator:
386+
387+
.. list-table::
388+
:header-rows: 1
389+
:widths: 20 60 20
390+
391+
* - Specifiers
392+
- Description
393+
- Possible Values
394+
395+
* - ``%b``
396+
- Abbreviated month name (3 letters)
397+
- ``jan``-``dec``
398+
399+
* - ``%B``
400+
- Full month name
401+
- ``january``-``december``
402+
381403
.. _7.0-time-series:
382404

383405
Time Series

0 commit comments

Comments
 (0)