timezone - Data-based MapReduce issue on MongoDB -
I am using mepradeus in mogodibi on a day-to-day basis. On the map code, I have the following snippet to get the day of the year:
var day = date.UTC (this.time.getFullYear (), this.time.getMonth (), This.time.getDate (), 1, 0, 0);
And in most cases, it works well. However, there is apparently a timezone issue, which transmits the time limit on the previous date. For example, the documents obtained from the result of this query:
{'time': {'$ gte': new date (2014, 0, 1, 0), '$ lt': New date (2014, 0, 1, 9)}}
A 2013-12-31 17: 00: 00.000Z and inquire with those who were asked with questions: / P>
{'time': {'$ gte': new date (2014, 0, 1, 9), '$ lt': new date (2014, 0, 1, 23)}}
Ending 2014-01-01 17: 00: 00.000Z How can I control it?
Be consistent with how you are making the date from January 1, 1970, to milliseconds Returns the number. Constructor gives a date object based on your local system settings for the timezone. This is the basic problem, I do not remember a lot from the code to believe in filling in the right statements, but you should be able to do this.
Comments
Post a Comment