I save my transaction with something like :
{code: \"A\", total: 250000, timestamp: ISODate(\"2016-01-20T23:57:05.771Z\")},
{code: \"B\", total: 300000, time
MongoDB 3.6 added timezone parameter to the date manipulation operators. See Kevin's answer.
We can add the "timestamp" to 7 * 60 * 60 * 1000 in a $project stage.
The following pipeline seems to work in MongoDB 3.4 or older.
db.collection.aggregate([
{ "$project": {
"year": { "$year": { "$add": [ "$timestamp", 7 * 60 * 60 * 1000 ] } },
"month": { "$month": { "$add": [ "$timestamp", 7 * 60 * 60 * 1000 ] } },
"day": { "$dayOfMonth": { "$add": [ "$timestamp", 7 * 60 * 60 * 1000 ] } }
} }
])