Converting Date data type field to Datetime data type

Converting Date data type field to Datetime data type

I'm trying to convert the value of a CRM field that is of Date data type to Datetime data type to be able to create a Meeting event from a Deluge script, but I keep getting this error. I have tried applying toDateTime() to the variable and specifying a format even when I don't care about the format. Can someone help me to identify what I'm missing?

Printouts:

  • 06-Aug-2024 00:00:00
  • {"code":"INVALID_DATA","details":{"expected_data_type":"datetime","api_name":"Start_DateTime"},"message":"invalid data","status":"error"}

Here's my code snippet:

phaseStartDate = phaseStartDate.toDateTime();
        info phaseStartDate;
calendarEventMap = {"Event_Title":"Update Phase for Account " + accountId,"Start_DateTime":phaseStartDate,"End_DateTime":phaseStartDate};
response = zoho.crm.createRecord("Events",calendarEventMap);