[DOCS-9873] Comment on: "manual/reference/operator/aggregation/dateToString.txt" Created: 08/Feb/17  Updated: 03/Nov/17  Resolved: 23/Aug/17

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Derick Rethans Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

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


Participants:
Days since reply: 6 years, 25 weeks, 1 day ago

 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" }



 Comments   
Comment by Kay Kim (Inactive) [ 23/Aug/17 ]

https://github.com/mongodb/docs/commit/fa0bdf1896b243922591f3653fea3ee3affbaca3

Generated at Thu Feb 08 07:59:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.