<?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: It is summer time again in Automations</title>
    <link>https://community.dynatrace.com/t5/Automations/It-is-summer-time-again/m-p/274804#M2120</link>
    <description>&lt;P&gt;Both,&lt;/P&gt;&lt;P&gt;Thanks for your reply's.&lt;/P&gt;&lt;P&gt;I did selected (before reading your great suggestions):&lt;/P&gt;&lt;P&gt;const myDate = new Date();&lt;BR /&gt;let localDateString = myDate.toLocaleString("en-US", { timeZone: "Europe/Amsterdam" });&lt;/P&gt;&lt;P&gt;After this I converted back to an object:&amp;nbsp;&lt;/P&gt;&lt;P&gt;let localDate = new Date(localDateString);&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so later in the script I can use the well known methods like localDate.getHours();&lt;/P&gt;&lt;P&gt;Again thanks for your help!&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Apr 2025 18:42:37 GMT</pubDate>
    <dc:creator>henk_stobbe</dc:creator>
    <dc:date>2025-04-09T18:42:37Z</dc:date>
    <item>
      <title>It is summer time again</title>
      <link>https://community.dynatrace.com/t5/Automations/It-is-summer-time-again/m-p/274262#M2104</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I really wat to use the local time in my workflow, new Date() always returns UTC.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Who knows how to do this?&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 18:18:02 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/It-is-summer-time-again/m-p/274262#M2104</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2025-04-02T18:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: It is summer time again</title>
      <link>https://community.dynatrace.com/t5/Automations/It-is-summer-time-again/m-p/274487#M2105</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Are you talking about the JS code in workflow? The &lt;EM&gt;"new Date()"&lt;/EM&gt; seems to be javascript sintax&lt;BR /&gt;&lt;BR /&gt;Anyway, after getting the date in UTC, convert it in your timezone when you are getting the string.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;!--  ScriptorStartFragment  --&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="markup"&gt;let localDate = new Date();
 

let dateOptions = { timeZone: 'Europe/Rome' };
let localDateString = localDate.toLocaleDateString('en-US', dateOptions);
let localTimeString = localDate.toLocaleTimeString('en-US', dateOptions);
 

console.log(`Date: ${localDateString}`);
console.log(`Time: ${localTimeString}`);&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;!--  ScriptorEndFragment  --&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Apr 2025 18:27:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/It-is-summer-time-again/m-p/274487#M2105</guid>
      <dc:creator>yanezza</dc:creator>
      <dc:date>2025-04-05T18:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: It is summer time again</title>
      <link>https://community.dynatrace.com/t5/Automations/It-is-summer-time-again/m-p/274500#M2106</link>
      <description>&lt;P&gt;Cool, thanks. Yep I am using this in a WF&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Apr 2025 09:21:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/It-is-summer-time-again/m-p/274500#M2106</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2025-04-06T09:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: It is summer time again</title>
      <link>https://community.dynatrace.com/t5/Automations/It-is-summer-time-again/m-p/274532#M2107</link>
      <description>&lt;P&gt;You can also use the now() expression &lt;A href="https://docs.dynatrace.com/docs/analyze-explore-automate/workflows/reference#now" target="_blank"&gt;Expression reference — Dynatrace Docs&lt;/A&gt;&lt;BR /&gt;This supports timezones, returns a datetime object, which you can use to do timecalculation in your expression as well like so &lt;A href="https://docs.dynatrace.com/docs/shortlink/automation-workflow-expression-reference#timedelta" target="_blank"&gt;https://docs.dynatrace.com/docs/shortlink/automation-workflow-expression-reference#timedelta&lt;/A&gt; and you can serialize it into any kind of date/time format you like, eg:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;{{ now('Europe/Vienna').strftime("%b %d %Y") }}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChristopherHejl_0-1744012103748.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27441iD62CA73E2B0563E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChristopherHejl_0-1744012103748.png" alt="ChristopherHejl_0-1744012103748.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChristopherHejl_1-1744012111737.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/27442iAAEC5E2E5F8B9E99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChristopherHejl_1-1744012111737.png" alt="ChristopherHejl_1-1744012111737.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2025 07:48:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/It-is-summer-time-again/m-p/274532#M2107</guid>
      <dc:creator>ChristopherHejl</dc:creator>
      <dc:date>2025-04-07T07:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: It is summer time again</title>
      <link>https://community.dynatrace.com/t5/Automations/It-is-summer-time-again/m-p/274804#M2120</link>
      <description>&lt;P&gt;Both,&lt;/P&gt;&lt;P&gt;Thanks for your reply's.&lt;/P&gt;&lt;P&gt;I did selected (before reading your great suggestions):&lt;/P&gt;&lt;P&gt;const myDate = new Date();&lt;BR /&gt;let localDateString = myDate.toLocaleString("en-US", { timeZone: "Europe/Amsterdam" });&lt;/P&gt;&lt;P&gt;After this I converted back to an object:&amp;nbsp;&lt;/P&gt;&lt;P&gt;let localDate = new Date(localDateString);&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so later in the script I can use the well known methods like localDate.getHours();&lt;/P&gt;&lt;P&gt;Again thanks for your help!&lt;/P&gt;&lt;P&gt;KR Henk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2025 18:42:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Automations/It-is-summer-time-again/m-p/274804#M2120</guid>
      <dc:creator>henk_stobbe</dc:creator>
      <dc:date>2025-04-09T18:42:37Z</dc:date>
    </item>
  </channel>
</rss>

