[meant to post this as it's own topic, must be some hidden metadata that makes this group in other Discussions!]
A little tip when working with Epoch based Dates:
function (doc, meta) {
if (meta.type == "json" && doc.type == "grouplevel") {
// create a new date
var dt = new Date(0)
// set number of seconds from epoch time in doc
dt.setUTCSeconds(doc.timestamp);
// convert to array
var da = dateToArray(dt)
}
}
Results of the Indexed Key : [2012,10,24,19,12,11]
If you just do (for epoch times)
var dt = new Date(doc.timestamp)
var da = dateToArray(dt)
You'd get: [1970,1,16,15,18,25]
Which isn't what you're looking for!