[SERVER-23747] Error Get time difference between two dates in seconds Created: 15/Apr/16 Updated: 22/Feb/18 Resolved: 25/Apr/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 3.3.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | shibimukesh | Assignee: | Kelsey Schubert |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
Calculating seconds between two dates error in mongodb
|
| Comments |
| Comment by Anurag Gupta [ 22/Feb/18 ] |
|
how to calculate date difference in days? |
| Comment by Kelsey Schubert [ 25/Apr/16 ] |
|
Hi shibish, Yes, the aggregation pipeline supports the operations that you describe. From your responses, I do not see anything to indicate a bug in the MongoDB server. For MongoDB-related support discussion please post on the mongodb-users group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-users group. Thank you, |
| Comment by shibimukesh [ 18/Apr/16 ] |
|
Respect Thomas Schubert, }}) this was my query i need to take the difference between the date and time Best Regards, *Shibi.M*Hadoop Developer NDOT Technologies Pvt Ltd, shibi.m@ndot.in US : +1 (323) 982-8943 <http://www.ndot.in/>Enterprise Mobility – CRM – ERP – Mobile – Web – INDIA (HQ) - Singapore - United States - Dubai - Morocco – Spain - DISCLAIMER: The information contained in this message (including any attachments) is On Fri, Apr 15, 2016 at 9:16 PM, Thomas Schubert (JIRA) <jira@mongodb.org> |
| Comment by shibimukesh [ 18/Apr/16 ] |
|
db.collection.aggregate({$project:{"dateDifference": { $subtract: [ ISODate("2015-05-30T10:01:58.000Z"),"$date"]}}}) |
| Comment by Kelsey Schubert [ 15/Apr/16 ] |
|
Hi shibish, Can you please clarify what the error is that you are seeing? Can you provide the output after running query in the description? Thank you, |
| Comment by shibimukesh [ 15/Apr/16 ] |
|
how to calculate time difference in seconds for two dates |