<?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: Arcade Hour() to return 12 hour clock? in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/arcade-hour-to-return-12-hour-clock/m-p/1073878#M5930</link>
    <description>&lt;P&gt;As to the final text you want, the format doesn't make a great deal of sense to me, also your description of 1 hour before, then wanting 1 hour after.&amp;nbsp; I've written the code to make the timegap variable.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//negative for before, positive for after
var timeGap = 1
//add or minus x hours
var adjustedDate = DateAdd( Now(), timeGap, 'hours' )

//just the hours, no mins and AM/PM
//if u need mins also - 'h:mm A'
var adjustedDateTxt = Text(adjustedDate,'h A')

var beforeAfter = ''
if (timeGap &amp;gt;= 0) {
    beforeAfter = 'Later' 
}
else {
    beforeAfter = 'Before'
}

adjustedDateTxt = Text(abs(timeGap)) + ' Hour(s) ' + beforeAfter + ': Current Hour is: ' + adjustedDateTxt
return adjustedDateTxt&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 29 Jun 2021 20:16:43 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2021-06-29T20:16:43Z</dc:date>
    <item>
      <title>Arcade Hour() to return 12 hour clock?</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-hour-to-return-12-hour-clock/m-p/1073403#M5927</link>
      <description>&lt;P&gt;Hoping this is the correct place - New to Arcade.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to get the Hour in a 12 hour clock format to return for a label and pop up. Currently showing the time in different time zone polygons. But I'm getting the 24 hour time since I am using the Hour() function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advise to make this --&amp;gt;&amp;nbsp; &amp;nbsp; Hour(Now())-1&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;read in 12 hours instead when I add in a custom expression to the pop-up. ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 19:26:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-hour-to-return-12-hour-clock/m-p/1073403#M5927</guid>
      <dc:creator>BugPie</dc:creator>
      <dc:date>2021-06-28T19:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Hour() to return 12 hour clock?</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-hour-to-return-12-hour-clock/m-p/1073410#M5928</link>
      <description>&lt;P&gt;&lt;A href="https://support.esri.com/en/technical-article/000018309" target="_blank"&gt;How To: Add AM or PM in a web map pop-up (esri.com)&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var n = Now(); Text(n,'h:mm A')&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 28 Jun 2021 19:41:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-hour-to-return-12-hour-clock/m-p/1073410#M5928</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-06-28T19:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Hour() to return 12 hour clock?</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-hour-to-return-12-hour-clock/m-p/1073803#M5929</link>
      <description>&lt;P&gt;Hi David - thank you for that link. Works great when I use it as is!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wondering if you had any advice as to how to use it with my custom expressions? I'm having trouble applying that to the below example. I am trying to get each label to display the time minus x hours from NOW.&amp;nbsp; I'd like the below result to read "2" or "2PM" not "14"&lt;/P&gt;&lt;P&gt;Concatenate("1 Hour Later: Current Hour is: " , Hour(Now())+1)&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Result&lt;/TD&gt;&lt;TD&gt;1 Hour Later: Current Hour is: 14&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 17:34:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-hour-to-return-12-hour-clock/m-p/1073803#M5929</guid>
      <dc:creator>BugPie</dc:creator>
      <dc:date>2021-06-29T17:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Hour() to return 12 hour clock?</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-hour-to-return-12-hour-clock/m-p/1073878#M5930</link>
      <description>&lt;P&gt;As to the final text you want, the format doesn't make a great deal of sense to me, also your description of 1 hour before, then wanting 1 hour after.&amp;nbsp; I've written the code to make the timegap variable.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//negative for before, positive for after
var timeGap = 1
//add or minus x hours
var adjustedDate = DateAdd( Now(), timeGap, 'hours' )

//just the hours, no mins and AM/PM
//if u need mins also - 'h:mm A'
var adjustedDateTxt = Text(adjustedDate,'h A')

var beforeAfter = ''
if (timeGap &amp;gt;= 0) {
    beforeAfter = 'Later' 
}
else {
    beforeAfter = 'Before'
}

adjustedDateTxt = Text(abs(timeGap)) + ' Hour(s) ' + beforeAfter + ': Current Hour is: ' + adjustedDateTxt
return adjustedDateTxt&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Jun 2021 20:16:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-hour-to-return-12-hour-clock/m-p/1073878#M5930</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-06-29T20:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Hour() to return 12 hour clock?</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-hour-to-return-12-hour-clock/m-p/1074174#M5931</link>
      <description>&lt;P&gt;WOW!&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/167692"&gt;@DavidPike&lt;/a&gt;&amp;nbsp; this is great. This is exactly what I was trying to accomplish, and you have verified that I was never going to get there myself, lol.&amp;nbsp; I appreciate your time and insight on this - I'll certainly be using this to unpack and help teach myself. So helpful!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 14:29:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-hour-to-return-12-hour-clock/m-p/1074174#M5931</guid>
      <dc:creator>BugPie</dc:creator>
      <dc:date>2021-06-30T14:29:26Z</dc:date>
    </item>
  </channel>
</rss>

