I am making a server call querying a record using a datetime filter like follows:
query.filters.CreatedDate._greaterThan = new Date('2020-04-20 19:39:56');
CreateDate is type datetime on a mysql database. But when I run this query I get the following error:
Expected Date for filtering by 'CreatedDate'. Error: Expected Date for filtering by 'CreatedDate'. at appStartUp (DashboardServer:77)
I have no idea why is there a type mismatch. I have also tried converting JS datetime to mysql datetime using the following and many other snippets but still I am recieving the same error.
new Date(); d.toISOString().split('T')[0]+' '+d.toTimeString().split(' ')[0];
Any help will be greatly appreciated.