No title Revision 333065396239 (Wed Jan 27 2010 at 19:43) - Diff Link to this snippet: https://friendpaste.com/3VFWC3DftLPeplmusvdeUg Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 12345678910111213141516171819function(doc) { if (doc.createdAt) { var d = new Date(doc.createdAt * 1000); var getOldDate = function (d) { function f(n) { // Format integers to have at least two digits. return n < 10 ? '0' + n : n; } return d.getUTCFullYear() + '-' + f(d.getUTCMonth() + 1) + '-' + f(d.getUTCDate()) + 'T' + f(d.getUTCHours()) + ':' + f(d.getUTCMinutes()) + ':' + f(d.getUTCSeconds()) + 'Z'; } emit(getOldDate(d), {email: doc.email, firstname: doc.firstname, lastname:doc.lastname}); }}