4

We are using MongoDB 2.4.9 (64 bits) over Windows 7 SP1 (64 bits). When we run the query below and we have any person in our collection with date of birth before the year of 1970 we get the exception "gmtime failed - your system doesn't support dates before 1970".

db.persons.aggregate({
  $project: { 
    date: { 
      year: { $year: "$DateOfBirth" },
      month: { $month: "$DateOfBirth" }, 
      day: { $dayOfMonth: "$DateOfBirth" }
    }
  }
})

I've read in other threads that it's a known issue when running MongoDB on certain Windows versions. Note that our project cannot be deployed in other platform than Microsoft.

Lucas Zamboulis
  • 2,494
  • 5
  • 24
  • 27
  • Similar question can be found here. See if it helps: http://stackoverflow.com/questions/13903687/mongodb-aggregate-framework-group-by-year – Sarath Nair Feb 19 '14 at 05:46
  • It is in fact a duplicate question to the one referenced. The answers are not very savory, and this seems to be totally lacking an oustanding JIRA issue. – Neil Lunn Feb 19 '14 at 06:57
  • 1
    @NeilLunn: I just created [SERVER-12816](https://jira.mongodb.org/browse/SERVER-12816) to track this. – jmikola Feb 21 '14 at 03:54

0 Answers0