<?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 Re: Set current date as dynamic field value in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841708#M498634</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Refer below links.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=4805b7a8db629700fff8a345ca9619d9"&gt;https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=4805b7a8db629700fff8a345ca9619d9&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=c1b26cf6db50e348fff8a345ca9619d5"&gt;https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=c1b26cf6db50e348fff8a345ca9619d5&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=39bc0fe5db9cdbc01dcaf3231f961964"&gt;https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=39bc0fe5db9cdbc01dcaf3231f961964&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Mark it correct and helpful.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Bhagyashri Sorte.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Sep 2020 12:36:53 GMT</pubDate>
    <dc:creator>Bhagyashri Sort</dc:creator>
    <dc:date>2020-09-18T12:36:53Z</dc:date>
    <item>
      <title>Set current date as dynamic field value</title>
      <link>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841701#M498627</link>
      <description>&lt;P&gt;I'm trying to use ATF to test the Change process, and when closing off the implementation phase I would like to use the current date set programatically, rather than having to set this manually before running the test. I don't seem to see any options for setting dynamic date/time values when setting up test steps, does anyone know if this is possible?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 10:59:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841701#M498627</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2020-09-18T10:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Set current date as dynamic field value</title>
      <link>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841702#M498628</link>
      <description>&lt;P&gt;Hello -&amp;nbsp; try below as a&amp;nbsp;value&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;javascript: gs.nowDateTime();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;javascript: new GlideDateTime();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is Date field NOT Date/Time then try below&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;javascript: new GlideDateTime().getDate();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Sep 2020 11:14:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841702#M498628</guid>
      <dc:creator>MrMuhammad</dc:creator>
      <dc:date>2020-09-18T11:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set current date as dynamic field value</title>
      <link>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841703#M498629</link>
      <description>&lt;P&gt;The below thread is not a direct solution to&amp;nbsp;your question but I am adding as a helpful material here, In addition to my above response.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=4805b7a8db629700fff8a345ca9619d9" target="_blank"&gt;Dynamic Date population in the Set Field Values in the Automated Test Framework (ATF)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 11:19:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841703#M498629</guid>
      <dc:creator>MrMuhammad</dc:creator>
      <dc:date>2020-09-18T11:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set current date as dynamic field value</title>
      <link>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841704#M498630</link>
      <description>&lt;P&gt;Updated above response to add third option.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 11:22:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841704#M498630</guid>
      <dc:creator>MrMuhammad</dc:creator>
      <dc:date>2020-09-18T11:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set current date as dynamic field value</title>
      <link>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841705#M498631</link>
      <description>&lt;P&gt;In the ATF, select the test step as 'Set Field Values' and try below&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/47381iE921B1B30D92FE1F/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/47381iE921B1B30D92FE1F/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Select the field for which you want to set current date and time and use the code as 'javascript: gs.nowDateTime()'&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 11:54:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841705#M498631</guid>
      <dc:creator>mr18</dc:creator>
      <dc:date>2020-09-18T11:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Set current date as dynamic field value</title>
      <link>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841706#M498632</link>
      <description>&lt;P&gt;As I mentioned in my first response, for the &lt;SPAN style="text-decoration: underline;"&gt;Date&lt;/SPAN&gt; field we need to use below&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;javascript: gs.nowDateTime().getDate();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;without calling &lt;EM&gt;getDate()&lt;/EM&gt; it will return &lt;SPAN style="text-decoration: underline;"&gt;Date and Time&lt;/SPAN&gt; which will cause a problem here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 12:08:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841706#M498632</guid>
      <dc:creator>MrMuhammad</dc:creator>
      <dc:date>2020-09-18T12:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set current date as dynamic field value</title>
      <link>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841707#M498633</link>
      <description>&lt;P&gt;If you will see my reply I have mentioned clearly which test step he has to use in order to do that&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 12:13:52 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841707#M498633</guid>
      <dc:creator>mr18</dc:creator>
      <dc:date>2020-09-18T12:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set current date as dynamic field value</title>
      <link>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841708#M498634</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Refer below links.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=4805b7a8db629700fff8a345ca9619d9"&gt;https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=4805b7a8db629700fff8a345ca9619d9&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=c1b26cf6db50e348fff8a345ca9619d5"&gt;https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=c1b26cf6db50e348fff8a345ca9619d5&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=39bc0fe5db9cdbc01dcaf3231f961964"&gt;https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=39bc0fe5db9cdbc01dcaf3231f961964&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Mark it correct and helpful.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Bhagyashri Sorte.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 12:36:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841708#M498634</guid>
      <dc:creator>Bhagyashri Sort</dc:creator>
      <dc:date>2020-09-18T12:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Set current date as dynamic field value</title>
      <link>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841709#M498635</link>
      <description>&lt;P&gt;&lt;SN-MENTION class="sn-mention" table="live_profile" sysid="ec5f4ae5db181fc09c9ffb651f961993"&gt;@Adam Domanski&lt;/SN-MENTION&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you should set the local date as below in the ATF test steo&lt;/P&gt;
&lt;P&gt;javascript: new GlideDateTime().getLocalDate();&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 12:57:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/set-current-date-as-dynamic-field-value/m-p/1841709#M498635</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2020-09-18T12:57:18Z</dc:date>
    </item>
  </channel>
</rss>

