node-orm2
node-orm2 copied to clipboard
Can't get DATETIME milliseconds?
I defined a datetime field
modifiedDate: {type: 'date', time: true, required: true},
save an item
item.modifiedDate = new Date();
item.save(...);
find the item
Item.get(..., function(err, item) {
console.log(item.modifiedDate.getMilliseconds()); // will print '0'
});
I have altered the column to TIMESTAMP type in MySQL level, and it can return milliseconds now. How to define a TIMESTAMP field program programmatically ?
You will likely need to add a custom type.