Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
*Location*: https://docs.mongodb.com/manual/reference/operator/aggregation/dateToString/#exp._S_dateToString
*User-Agent*: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36
*Referrer*: https://docs.mongodb.com/manual/reference/operator/aggregation-date/
*Screen Resolution*: 1600 x 1200
*Location*: https://docs.mongodb.com/manual/reference/operator/aggregation/dateToString/#exp._S_dateToString *User-Agent*: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36 *Referrer*: https://docs.mongodb.com/manual/reference/operator/aggregation-date/ *Screen Resolution*: 1600 x 1200
Description
The description for %u is wrong:
| Day of week number in ISO 8601 format (1-Sunday, 7-Saturday) |
It should be:
| Day of week number in ISO 8601 format (1-Monday, 7-Sunday) |
> db.tz.insert( { d: new ISODate( "2017-02-06" ) } );
|
WriteResult({ "nInserted" : 1 })
|
> db.tz.aggregate( [ { $project: { 'w': { $dateToString : { format: '%w', date: '$d' } }, 'u' : { $dateToString : { format: '%u', date: '$d' } } }} ] );
|
{ "_id" : ObjectId("589b0961da41ef23b502910d"), "w" : "2", "u" : "1" }
|