Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to deal with the timezone issue when storing dates in utc using mongod?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COCan you be clearer about what you're trying to do any why you can't just convert to the client's timezone post aggregation? You could always use mapreduce instead of the aggregation framework - it will be slower but will allow any sort of ad hoc calculation you need to do
      singulars
    2. COActually, I need to generate weekly reports for the user based on his/her timezone. For the report, I need to use the aggregation framework. Problem is, I should take into account the user's timezone while aggregating. I cannot do so after aggregation as that will result in wrong results. Map reduce is an option but I need this on demand and I saw while searching StackOverflow that it shouldn't be used in place of a query. I was hoping there'd be some way.
      singulars
    3. COI don't know about MongoDB well enough to answer, but I believe the approach would be similar to what I describe for RavenDB [here](http://ravendb.net/kb/61/working-with-date-and-time-in-ravendb#time-zone-conversions), and again in the [`Foo_ByDate_MultiZone` index here](https://github.com/mj1856/RavenDB-NodaTime/wiki/Indexing-and-Querying). If Mongo allows something similar, you would do this in the Map, just like I did in Raven.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload