I have a column defined with type time and column defined with type date.
knex.schema.createTable('receipt', function(table) {
...
table.date('t_date');
table.time('t_time');
...
});
It stores data in 24hour format in Database. eg: 22:00:00. Date as '2018-11-30'. But when I run a select query it returns.
{
...
"transactionDate": "2018-11-29T00:00:00.000Z",
"transactionTime": "1970-01-01T22:20:00.000Z",
...
}
How to get date from select query with date with format YYYY-MM-dd
and time as HH:mm:ssAM/PM
?