<?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 Display only the date from a datetime field in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/display-only-the-date-from-a-datetime-field/m-p/1697713#M354639</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I have a notification running on the sc_task table. I want to display the due date field from the RITM to the notification.&lt;BR /&gt;I can do this by dot walk. However, I only want to display the date section (bold part from the sample) of the value.&lt;/P&gt;
&lt;P&gt;Due date: &lt;STRONG&gt;2020-12-15&lt;/STRONG&gt; 16:00:00 PST&lt;/P&gt;
&lt;P&gt;Is this possible?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2020 09:27:05 GMT</pubDate>
    <dc:creator>ceraulo</dc:creator>
    <dc:date>2020-12-14T09:27:05Z</dc:date>
    <item>
      <title>Display only the date from a datetime field</title>
      <link>https://www.servicenow.com/community/developer-forum/display-only-the-date-from-a-datetime-field/m-p/1697713#M354639</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I have a notification running on the sc_task table. I want to display the due date field from the RITM to the notification.&lt;BR /&gt;I can do this by dot walk. However, I only want to display the date section (bold part from the sample) of the value.&lt;/P&gt;
&lt;P&gt;Due date: &lt;STRONG&gt;2020-12-15&lt;/STRONG&gt; 16:00:00 PST&lt;/P&gt;
&lt;P&gt;Is this possible?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 09:27:05 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/display-only-the-date-from-a-datetime-field/m-p/1697713#M354639</guid>
      <dc:creator>ceraulo</dc:creator>
      <dc:date>2020-12-14T09:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Display only the date from a datetime field</title>
      <link>https://www.servicenow.com/community/developer-forum/display-only-the-date-from-a-datetime-field/m-p/1697714#M354640</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;On the Notification Email Script, you can take like this.&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;var gdt_duedate = new GlideDateTime(current.&amp;lt;duedate variable&amp;gt;);
var gd_duedate = new GlideDate();
gd_duedate.setValue(gdt_duedate);

var onlydate = gd_duedate.getByFormat("MM/dd/yyyy").toString();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark it as correct answer if your issue resolves.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Narsing&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 09:37:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/display-only-the-date-from-a-datetime-field/m-p/1697714#M354640</guid>
      <dc:creator>Narsing1</dc:creator>
      <dc:date>2020-12-14T09:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Display only the date from a datetime field</title>
      <link>https://www.servicenow.com/community/developer-forum/display-only-the-date-from-a-datetime-field/m-p/1697715#M354641</link>
      <description>&lt;P&gt;&lt;SN-MENTION class="sn-mention" table="live_profile" sysid="e5b01aaddb581fc09c9ffb651f9619d3"&gt;@ceraulo&lt;/SN-MENTION&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will require to handle this via email script&lt;/P&gt;
&lt;P&gt;Then include that email script in your notification body using ${mail_script:mailScriptName}&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;(function runMailScript(current, template, email, email_action, event) {

    // Add your code here

var gdt = new GlideDateTime(current.request_item.due_date);

var date = gdt.getLocalDate();

template.print('Date'+ date);

})(current, template, email, email_action, event);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 09:37:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/display-only-the-date-from-a-datetime-field/m-p/1697715#M354641</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2020-12-14T09:37:22Z</dc:date>
    </item>
  </channel>
</rss>

