[SERVER-50336] $dateFromString support for additional format specifiers (such as "%j" for day of year) Created: 17/Aug/20 Updated: 29/Oct/23 Resolved: 27/Jan/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework, Querying |
| Affects Version/s: | None |
| Fix Version/s: | 6.3.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Alex Bevilacqua | Assignee: | Jennifer Peshansky (Inactive) |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | qexec-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||
| Description |
|
The $dateFromString Format Specifiers don't include the strftime %j modifier which is used to decode the day of the year as a decimal number (range 001 to 366). It appears that this modifier is understood as part of kDateToStringFormatMap from timelib's TIMELIB_FORMAT_DAY_OF_YEAR when converting from a date to a string, but not from a string to a date. For example:
Note that for the above we were able to work around this limitation as follows:
|
| Comments |
| Comment by Githook User [ 27/Jan/23 ] |
|
Author: {'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}Message: |
| Comment by Asya Kamsky [ 22/Dec/22 ] |
|
Seems rather peculiar there's no symmetry between conversion from and to string. Question came up about %B and %b This seems like it would might an easy quick win or neweng ticket, no?
|