<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom Code to change Date/Time stamp to Date in &amp;#128172 RevOps Discussions</title>
    <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1069765#M2829</link>
    <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/781414"&gt;@lana604&lt;/a&gt;&amp;nbsp;Did they ever get back to you? I am running into the same exact error. I've tried date fields, datetime fields, and nothing will accept the millisecond time stamp&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2024 19:28:34 GMT</pubDate>
    <dc:creator>LeanData-TonyJ</dc:creator>
    <dc:date>2024-11-14T19:28:34Z</dc:date>
    <item>
      <title>Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/995766#M2496</link>
      <description>&lt;P&gt;I have a workflow rule where I grab a date/time field with custom code and update that field to a date field (MM/DD/YYYY) as an output.&lt;BR /&gt;&lt;BR /&gt;Example:&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;Date/time: 2024-06-21T00:29:23.243Z&lt;BR /&gt;&lt;/SPAN&gt;Date: 06/21/2024&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I receive a "Success" message when testing the custom code. However, when I copy the output date and input it into my "signup_date" field I receive a message saying "Unable to update property because property value isn't valid." I've played around with the format of the output date to YYYY/MM/DD and DD/MM/YYYY as well as with "-" instead of "/" ... but no luck! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;How can I fix this?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Custom Code" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120261iAE0D8C076B18F117/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-06-21_11-46-15.png" alt="Custom Code" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Custom Code&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Success Message from Code" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120262iCF6C73A171BC72E0/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-06-21_11-46-33.png" alt="Success Message from Code" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Success Message from Code&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Workflow" style="width: 496px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120263iDEFC7DE0EB0400A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-06-21_11-48-23.png" alt="Workflow" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Workflow&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error Message" style="width: 487px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120264iBE39051AC3BC6B7A/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-06-21_11-35-34.png" alt="Error Message" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Error Message&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 19:03:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/995766#M2496</guid>
      <dc:creator>lana604</dc:creator>
      <dc:date>2024-06-21T19:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/995852#M2497</link>
      <description>&lt;P&gt;What is the field type for that signup_date custom field?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2024 01:42:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/995852#M2497</guid>
      <dc:creator>RaymondThomas</dc:creator>
      <dc:date>2024-06-22T01:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/995853#M2498</link>
      <description>&lt;P&gt;That and check for property validation rules&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2024 01:45:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/995853#M2498</guid>
      <dc:creator>RaymondThomas</dc:creator>
      <dc:date>2024-06-22T01:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/996520#M2505</link>
      <description>&lt;P&gt;It's a Date Picker field. My date format is the United States, so MM/DD/YYYY.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lana604_0-1719251035563.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120371i56D1F145558D937A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lana604_0-1719251035563.png" alt="lana604_0-1719251035563.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I do not have any validation rules associated to the field.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lana604_1-1719251141158.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120372i0D0D1ACFD2D9523A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lana604_1-1719251141158.png" alt="lana604_1-1719251141158.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 17:45:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/996520#M2505</guid>
      <dc:creator>lana604</dc:creator>
      <dc:date>2024-06-24T17:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/996574#M2508</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/781414"&gt;@lana604&lt;/a&gt;&amp;nbsp;- based on my own efforts on this topic, the only acceptable format for a date output from a custom code workflow is a timestamp value in milliseconds - not a formatted date string as you might expect. As in&amp;nbsp;1708905600000 rather than&amp;nbsp;2024-02-26.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 20:15:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/996574#M2508</guid>
      <dc:creator>SteveHTM</dc:creator>
      <dc:date>2024-06-24T20:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/997245#M2511</link>
      <description>&lt;P&gt;Hi Steve,&lt;BR /&gt;&lt;BR /&gt;I updated the output code to time stamp value in milliseconds, unfortunately, when I copy the property value to my date field, I get the same error where "property value is not valid...."&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm thinking this might be a HubSpot limitation. I have developers looking into this but so far no luck .&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 20:34:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/997245#M2511</guid>
      <dc:creator>lana604</dc:creator>
      <dc:date>2024-06-25T20:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/999005#M2512</link>
      <description>&lt;P&gt;The date must best set to midnight in order to copy via native workflows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are my tests:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="code used" style="width: 726px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120748i7087AB7CC0412C72/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-06-28 at 10.33.24 PM.png" alt="code used" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;code used&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="output defined as datetime" style="width: 726px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120749iA1C4F4B78377B533/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-06-28 at 10.33.28 PM.png" alt="output defined as datetime" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;output defined as datetime&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="in milliseconds with time set to midnight" style="width: 726px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120750i165A0E6858049BD6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-06-28 at 10.34.25 PM.png" alt="in milliseconds with time set to midnight" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;in milliseconds with time set to midnight&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="string set to midnight" style="width: 726px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120752i54C13AC666536AA9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-06-28 at 10.28.23 PM.png" alt="string set to midnight" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;string set to midnight&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-06-28 at 10.39.53 PM.png" style="width: 726px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/120753i86C14757EC105301/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-06-28 at 10.39.53 PM.png" alt="Screenshot 2024-06-28 at 10.39.53 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2024 03:40:48 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/999005#M2512</guid>
      <dc:creator>Bortami</dc:creator>
      <dc:date>2024-06-29T03:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1000138#M2513</link>
      <description>&lt;P&gt;Thank you Bortami, this did the trick!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To summarize to copy the date time fields to a date field, the custom code must change the date/time field to set to UNIX milliseconds at midnight.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 17:41:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1000138#M2513</guid>
      <dc:creator>lana604</dc:creator>
      <dc:date>2024-07-02T17:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1046272#M2699</link>
      <description>&lt;P&gt;Ran into the same issue. With Python custom code. Got it to work by formatting the date as a timestamp in milliseconds AND ensuring it is an integer (rather than any kind of floating point number, I suppose):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-26 at 11.12.31.png" style="width: 769px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/127879i00D05F2BF4EEA2AF/image-dimensions/769x25?v=v2" width="769" height="25" role="button" title="Screenshot 2024-09-26 at 11.12.31.png" alt="Screenshot 2024-09-26 at 11.12.31.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Response type of the custom code is set to "Date":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-26 at 11.13.22.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/127880iA8AC5FE8DE9FA278/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-09-26 at 11.13.22.png" alt="Screenshot 2024-09-26 at 11.13.22.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output now looks like this and is accepted by a "Copy property" action writing to a DatePicker field.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-26 at 11.13.53.png" style="width: 753px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/127881iDBDAA21CA62172AD/image-dimensions/753x32?v=v2" width="753" height="32" role="button" title="Screenshot 2024-09-26 at 11.13.53.png" alt="Screenshot 2024-09-26 at 11.13.53.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 09:15:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1046272#M2699</guid>
      <dc:creator>svamann</dc:creator>
      <dc:date>2024-09-26T09:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1069765#M2829</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/781414"&gt;@lana604&lt;/a&gt;&amp;nbsp;Did they ever get back to you? I am running into the same exact error. I've tried date fields, datetime fields, and nothing will accept the millisecond time stamp&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 19:28:34 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1069765#M2829</guid>
      <dc:creator>LeanData-TonyJ</dc:creator>
      <dc:date>2024-11-14T19:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1070087#M2835</link>
      <description>&lt;P&gt;Did you ensure the timestamp is returned as int? Because if it's a string in the background, subsequent actions won't accept it... see &lt;A href="https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1046272/highlight/true#M2699" target="_blank" rel="noopener"&gt;my solution above&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 11:46:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1070087#M2835</guid>
      <dc:creator>svamann</dc:creator>
      <dc:date>2024-11-15T11:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1070298#M2837</link>
      <description>&lt;P&gt;I tried this as well. I have also tried almost every other output I could think of. However, I think the issue could be with the new consolidation of record updates on workflows. Since Clear, Copy, and Update are now consilidated into one action. Here is my code, any help would be very much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;exports.main = async (event, callback) =&amp;gt; {
  try {
    const contactId = event.object.objectId;
    const accessToken = process.env.PRIVATE_APP_ACCESS_TOKEN; // Access your secret here

    // Fetch associated deals for the contact
    const associationsResponse = await fetch(`https://api.hubapi.com/crm/v3/objects/contacts/${contactId}/associations/deals`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${accessToken}`,
        'Content-Type': 'application/json'
      }
    });

    const associationsData = await associationsResponse.json();
    console.log("Associations Data:", associationsData);

    if (!associationsData.results) {
      throw new Error("No associated deals found");
    }

    const dealIds = associationsData.results.map(deal =&amp;gt; deal.id);

    // Fetch details for each associated deal
    const dealDetailsPromises = dealIds.map(dealId =&amp;gt; 
      fetch(`https://api.hubapi.com/crm/v3/objects/deals/${dealId}`, {
        method: 'GET',
        headers: {
          Authorization: `Bearer ${accessToken}`,
          'Content-Type': 'application/json'
        },
        params: {
          properties: 'dealname,createdate'
        }
      })
    );

    const dealDetailsResponses = await Promise.all(dealDetailsPromises);
    const dealDetails = await Promise.all(dealDetailsResponses.map(res =&amp;gt; res.json()));

    // Extract deal names and set create dates to midnight UTC
    const dealsInfo = dealDetails.map(deal =&amp;gt; {
      const createDate = new Date(deal.properties.createdate);
      createDate.setUTCHours(0, 0, 0, 0); // Ensure midnight UTC
      return {
        name: deal.properties.dealname,
        createDate
      };
    });

    console.log("Deals Info:", dealsInfo);

    // Find the most recent deal create date
    const mostRecentDeal = dealsInfo.reduce((latest, current) =&amp;gt; 
      current.createDate &amp;gt; latest.createDate ? current : latest
    );

    const timestamp = mostRecentDeal.createDate.getTime();
    const isoString = mostRecentDeal.createDate.toISOString();
    const formattedDate = `${(mostRecentDeal.createDate.getMonth() + 1).toString().padStart(2, '0')}/${mostRecentDeal.createDate.getDate().toString().padStart(2, '0')}/${mostRecentDeal.createDate.getFullYear()}`;
    const formattedDateV2 = `${mostRecentDeal.createDate.getFullYear()}-${(mostRecentDeal.createDate.getMonth() + 1).toString().padStart(2, '0')}-${mostRecentDeal.createDate.getDate().toString().padStart(2, '0')}`;

    console.log("Most Recent Deal:", mostRecentDeal);
    console.log("Timestamp:", timestamp);
    console.log("ISO String:", isoString);
    console.log("Formatted Date:", formattedDate);
    console.log("Formatted Date:", formattedDateV2);

    // Return the most recent deal name and create date in various formats
    callback({
      outputFields: {
        associatedDealNames: mostRecentDeal.name,
        mostRecentDealCreateDate: timestamp, // Use timestamp
        mostRecentDealCreateDateISO: isoString, // Use ISO string
        mostRecentDealCreateDateFormatted: formattedDateV2, // Use formatted date
        mostRecentDealCreateDateV2: parseInt(timestamp), // Use timestamp
        mostRecentDealCreateTimeStamp: Math.floor(timestamp),
        mostRecentDealDateNumber: parseInt(timestamp)
      }
    });
  } catch (error) {
    console.error("Error:", error.message);
    callback({
      outputFields: {
        associatedDealNames: "Error fetching deals",
        mostRecentDealCreateDate: "Error fetching date",
        mostRecentDealCreateDateISO: "Error fetching date",
        mostRecentDealCreateDateFormatted: "Error fetching date"
      }
    });
  }
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeanDataTonyJ_2-1731691928969.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/131740i363E938104872221/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeanDataTonyJ_2-1731691928969.png" alt="LeanDataTonyJ_2-1731691928969.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeanDataTonyJ_0-1731691770633.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/131738i39944F970A82B8F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeanDataTonyJ_0-1731691770633.png" alt="LeanDataTonyJ_0-1731691770633.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeanDataTonyJ_1-1731691846757.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/131739i4E54C4D987FD360A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeanDataTonyJ_1-1731691846757.png" alt="LeanDataTonyJ_1-1731691846757.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 17:33:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1070298#M2837</guid>
      <dc:creator>LeanData-TonyJ</dc:creator>
      <dc:date>2024-11-15T17:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Code to change Date/Time stamp to Date</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1072029#M2845</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/735819"&gt;@LeanData-TonyJ&lt;/a&gt;.&amp;nbsp; You must set&lt;SPAN&gt;&amp;nbsp;the custom code to update the date/time field and set it to UNIX milliseconds at midnight.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 01:54:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Custom-Code-to-change-Date-Time-stamp-to-Date/m-p/1072029#M2845</guid>
      <dc:creator>lana604</dc:creator>
      <dc:date>2024-11-20T01:54:37Z</dc:date>
    </item>
  </channel>
</rss>

