I created a function to pull data for the current day and create a pdf report, worked great. I want to make this a scheduled CC task that I would run every night. I know in CC the date is different and I convert to US time before comparing, but I never get a result. I have tried = and contains both. I have tried new Day() like I did in JS. timestamp is defined as datetime. Any ideas on this?
JS (returns correct count of orders)
var today = new Day();
var sjg = DB.storeroom_order_items.where('ship_to contains ? and timestamp = ?', '72156', today).orderBy('ship_to','username', '-timestamp').toArray();
CC (returns no orders found)
// Get orders for Today.
var usaTime = new Date().toLocaleString(“en-US”, {timeZone: “America/New_York”});
var today = (new Date(usaTime)).toISOString();
console.log('today: ’ + today);
var sjg = await DB.storeroom_order_items.where('ship_to contains ? and timestamp = ?', '72156', today).orderBy('ship_to', 'username', '-timestamp').toArray();