<?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 Timezone in the date() function- in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/timezone-in-the-date-function/m-p/1719314#M7767</link>
    <description>&lt;P&gt;I am building a new Arcade script for a Velocity Field Calculation ---&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the Date() functioon to retun the Epoc date.&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/date_functions/#date1" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/arcade/function-reference/date_functions/#date1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;My issue is that the Source data seems to use the four-character time zone, and Date() does not seem to like this. I can make this work with a DECODE for the two possible values in this routine, but that's not very generic.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to use the TimeZone Abbreviations versus the Time Zone Identifier.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on a better way to do this so I can pass EDT, or MDT, HST, or whatever into date() as the timeZone text value?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// receivedDT - Thu Aug 06 10:19:35 AKDT 2026&lt;BR /&gt;var alphaDate = split($feature["receivedDT"], " ");&lt;BR /&gt;var alphaTime = split(alphaDate[3], ":");&lt;BR /&gt;var textYear = alphaDate[5];&lt;BR /&gt;var textMonth = decode(lower(alphaDate[1]), 'jan', '00', 'feb', '01', 'mar', '02', 'apr', '03', 'may', '04',&lt;BR /&gt;'jun', '05', 'jul', '06', 'aug', '07', 'sep', '08', 'oct', '09', 'nov', '10', 'dec', '11', 00);&lt;BR /&gt;var textDay = alphaDate[2];&lt;BR /&gt;var textTZ = decode(upper(alphaDate[4]), 'AKDT', '&lt;A title="" href="https://en.wikipedia.org/wiki/America/Anchorage" target="_blank" rel="noopener"&gt;US/Alaska&lt;/A&gt;', 'AKST', '&lt;A title="" href="https://en.wikipedia.org/wiki/America/Anchorage" target="_blank" rel="noopener"&gt;US/Alaska&lt;/A&gt;', '&lt;A title="" href="https://en.wikipedia.org/wiki/America/Anchorage" target="_blank" rel="noopener"&gt;US/Alaska&lt;/A&gt;');&lt;BR /&gt;var textHour = alphaTime[0];&lt;BR /&gt;var textMin = alphaTime[1];&lt;BR /&gt;var textSec = alphaTime[2];&lt;BR /&gt;var utcDate = Date(Number(textYear), Number(textMonth), Number(textDay),&lt;BR /&gt;Number(textHour), Number(textMin), Number(textSec), 0, textTZ);&lt;BR /&gt;Console('UtcDate: ', utcDate);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Aug 2026 16:30:16 GMT</pubDate>
    <dc:creator>JeffSilberberg</dc:creator>
    <dc:date>2026-08-07T16:30:16Z</dc:date>
    <item>
      <title>Timezone in the date() function-</title>
      <link>https://community.esri.com/t5/developers-questions/timezone-in-the-date-function/m-p/1719314#M7767</link>
      <description>&lt;P&gt;I am building a new Arcade script for a Velocity Field Calculation ---&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the Date() functioon to retun the Epoc date.&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/date_functions/#date1" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/arcade/function-reference/date_functions/#date1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;My issue is that the Source data seems to use the four-character time zone, and Date() does not seem to like this. I can make this work with a DECODE for the two possible values in this routine, but that's not very generic.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to use the TimeZone Abbreviations versus the Time Zone Identifier.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on a better way to do this so I can pass EDT, or MDT, HST, or whatever into date() as the timeZone text value?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// receivedDT - Thu Aug 06 10:19:35 AKDT 2026&lt;BR /&gt;var alphaDate = split($feature["receivedDT"], " ");&lt;BR /&gt;var alphaTime = split(alphaDate[3], ":");&lt;BR /&gt;var textYear = alphaDate[5];&lt;BR /&gt;var textMonth = decode(lower(alphaDate[1]), 'jan', '00', 'feb', '01', 'mar', '02', 'apr', '03', 'may', '04',&lt;BR /&gt;'jun', '05', 'jul', '06', 'aug', '07', 'sep', '08', 'oct', '09', 'nov', '10', 'dec', '11', 00);&lt;BR /&gt;var textDay = alphaDate[2];&lt;BR /&gt;var textTZ = decode(upper(alphaDate[4]), 'AKDT', '&lt;A title="" href="https://en.wikipedia.org/wiki/America/Anchorage" target="_blank" rel="noopener"&gt;US/Alaska&lt;/A&gt;', 'AKST', '&lt;A title="" href="https://en.wikipedia.org/wiki/America/Anchorage" target="_blank" rel="noopener"&gt;US/Alaska&lt;/A&gt;', '&lt;A title="" href="https://en.wikipedia.org/wiki/America/Anchorage" target="_blank" rel="noopener"&gt;US/Alaska&lt;/A&gt;');&lt;BR /&gt;var textHour = alphaTime[0];&lt;BR /&gt;var textMin = alphaTime[1];&lt;BR /&gt;var textSec = alphaTime[2];&lt;BR /&gt;var utcDate = Date(Number(textYear), Number(textMonth), Number(textDay),&lt;BR /&gt;Number(textHour), Number(textMin), Number(textSec), 0, textTZ);&lt;BR /&gt;Console('UtcDate: ', utcDate);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2026 16:30:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/timezone-in-the-date-function/m-p/1719314#M7767</guid>
      <dc:creator>JeffSilberberg</dc:creator>
      <dc:date>2026-08-07T16:30:16Z</dc:date>
    </item>
  </channel>
</rss>

