DateTime formatting to query based on DateDue

Can someone tell me what’s wrong with the DateTime formatting I am using per these Keap docs → https://developer.infusionsoft.com/docs/xml-rpc/…

it looks like we should be sending the format
2017-01-01 00:00:00

which brings back a failed to parse error

I also tried to send a datetime with the following format:
2023-06-01T11:38:02Z

which is also bringing back a failed to parse error if someone could help me determine the exact dateformat I need to send that would be great below is the query I am trying to send. It would also be helpful if someone could help me determine how to successfully attach the >= operator:

const xml = `<?xml version='1.0' encoding='UTF-8'?>
    <methodCall>
      <methodName>DataService.query</methodName>
      <params>
        <param>
          <value><string>${Env.get('KEAP_CLIENT_ID')}</string></value>
        </param>
        <param>
          <value><string>PayPlanItem</string></value>
        </param>
        <param>
          <value><int>1000</int></value>
        </param>
        <param>
          <value><int>0</int></value>
        </param>
        <param>
          <value><struct>
            <member><name>Status</name>
            <value><string>3</string></value></member>
            <member><name>DateDue</name>
            <value><dateTime.iso8601> ${this.seventyFiveDays.toFormat(
              "yyyy-MM-dd'T'HH:mm:ssZZ"
            )}</dateTime.iso8601>
            </value></member>
          </struct></value>
        </param>
        <param>
          <value><array>
            <data>
              <value><string>Id</string></value>
              <value><string>PayPlanId</string></value>
              <value><string>DateDue</string></value>
            </data>
          </array></value>
        </param>
        <param>
          <value><string>Id</string></value>
        </param>  
        <param>
          <value><boolean>1</boolean></value>
        </param>
      </params>
    </methodCall>`

type or paste code here

Just to check, could you remove the extra space in front of your ${ to ensure it isn’t a padding issue?

Hi @Basel_Anani,

Not sure if you found the answer, but when using the XML-RPC you need to make sure that the Date Format is “Ymd\TH:i:s”.

PHP Example below showing the Current Date and Time based on EST Time Zone.
Note, Keap requires that in that Time Zone.

$date = new \DateTime();
$date->setTimezone(new \DateTimeZone('America/New_York'));
$date->format('Ymd\TH:i:s');

If you are still getting Parse Error after making that change, you need to double check the values you are sending.

Hope that helps.