var models = require('./models');
var utils = require('./utils');
var config = require('./config');
models.Order.find({}, function(err, results) {
console.log('models.Order.find type of datetime',results[0].attributes.datetime);
console.log('type of datetime', typeof results[0].attributes.datetime);
});
var query = {
updates: {
edit_token: utils.uuid.v4()
, edit_token_expires: moment().add('days', config.expires.shareLink).format('YYYY-MM-DD HH:mm:ss')
}
, where: {
id: 909
}
};
models.Order.update(query, function(err, results) {
console.log('models.Order.update',results[0].attributes.datetime);
console.log('type of datetime', typeof results[0].attributes.datetime);
});
Prints
models.Order.update Fri Mar 14 2014 16:30:00 GMT-0500 (CDT)
type of datetime object
models.Order.find type of datetime 2014-03-14 12:15:00
type of datetime string