<?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>question End Date in my client Script is getting set to incorrect time on the Ritm and record in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/end-date-in-my-client-script-is-getting-set-to-incorrect-time-on/m-p/3402964#M5046</link>
    <description>&lt;LI-CODE lang="javascript"&gt;var endofDay = new Date();
var dateEod = endofDay.setHours(17,0,0,0);

g_form.setValue('u_end_date', new Date(dateEod));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the output in the RITM is 2025- 10 - 10 00:00:00&lt;/P&gt;&lt;P&gt;on the catalog its&amp;nbsp;&lt;STRONG&gt;2025- 10 - 10 17:00:00&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Oct 2025 15:35:31 GMT</pubDate>
    <dc:creator>ServNowDev</dc:creator>
    <dc:date>2025-10-10T15:35:31Z</dc:date>
    <item>
      <title>End Date in my client Script is getting set to incorrect time on the Ritm and record</title>
      <link>https://www.servicenow.com/community/community-central-forum/end-date-in-my-client-script-is-getting-set-to-incorrect-time-on/m-p/3402964#M5046</link>
      <description>&lt;LI-CODE lang="javascript"&gt;var endofDay = new Date();
var dateEod = endofDay.setHours(17,0,0,0);

g_form.setValue('u_end_date', new Date(dateEod));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the output in the RITM is 2025- 10 - 10 00:00:00&lt;/P&gt;&lt;P&gt;on the catalog its&amp;nbsp;&lt;STRONG&gt;2025- 10 - 10 17:00:00&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2025 15:35:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/end-date-in-my-client-script-is-getting-set-to-incorrect-time-on/m-p/3402964#M5046</guid>
      <dc:creator>ServNowDev</dc:creator>
      <dc:date>2025-10-10T15:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: End Date in my client Script is getting set to incorrect time on the Ritm and record</title>
      <link>https://www.servicenow.com/community/community-central-forum/end-date-in-my-client-script-is-getting-set-to-incorrect-time-on/m-p/3403006#M5048</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/141862"&gt;@ServNowDev&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please use GlideAjax in your Client script and create a script include and add below code in your script include&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Client Script&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function onLoad() {
    var ga = new GlideAjax('GetEndOfDay');
    ga.addParam('sysparm_name', 'getEndOfDay');

    ga.getXMLAnswer(function(response) {
        if (response) {
            g_form.setValue('u_end_date', response);
        }
    });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Script Include&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var GetEndOfDay = Class.create();
GetEndOfDay.prototype = Object.extendsObject(AbstractAjaxProcessor, {

    getEndOfDay: function() {
        // Create a GlideDateTime object for current date
        var gdt = new GlideDateTime();
        
        // Set time to 17:00:00 (5 PM)
        gdt.setHourLocalTime(17);
        gdt.setMinuteLocalTime(0);
        gdt.setSecondLocalTime(0);
        gdt.setMillisecondLocalTime(0);

        // Return display value (string)
        return gdt.getDisplayValue();
    }

});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please mark my answer correct and helpful if this works for you&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sarthak&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2025 16:04:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/end-date-in-my-client-script-is-getting-set-to-incorrect-time-on/m-p/3403006#M5048</guid>
      <dc:creator>Sarthak Kashyap</dc:creator>
      <dc:date>2025-10-10T16:04:18Z</dc:date>
    </item>
  </channel>
</rss>

