<?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: Timestamps received from a sensor feed display differently in GeoEvent Sampler, ArcGIS REST Services queries, and ArcGIS Pro in ArcGIS GeoEvent Server Questions</title>
    <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268767#M3920</link>
    <description>&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Data from my sensor feed reports the date and time of each data record in separate fields. How do I combine these into a single Date attribute?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Use a &lt;EM&gt;Field Calculator&lt;/EM&gt; or &lt;EM&gt;Field Mapper&lt;/EM&gt; to combine the date and time values into a string which GeoEvent Server can interpret as a &lt;EM&gt;Date&lt;/EM&gt;. Your goal is to construct a single ISO 8601 formatted string that contains both the date and time values which you can then cast from &lt;EM&gt;String&lt;/EM&gt; to &lt;EM&gt;Date&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;For this example assume that &lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;ReportedDate&lt;/FONT&gt;&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;ReportedTime&lt;/FONT&gt;&lt;/STRONG&gt; hold the values "&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;02/16/2023&lt;/FONT&gt;&lt;/STRONG&gt;" and "&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;18:37:15&lt;/FONT&gt;&lt;/STRONG&gt;" respectively. Assume that the date and time are reported as local values, so a dynamic UTC offset should be applied to avoid errors when clocks are adjusted for Daylight Savings twice each year.&lt;/P&gt;&lt;P&gt;The string you are calculating for this example&amp;nbsp;&lt;SPAN&gt;should be:&amp;nbsp;&amp;nbsp;&lt;FONT face="helvetica" size="2"&gt;&lt;STRONG&gt;2023-02-16T18:37:15-00:00&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL class="lia-list-style-type-circle"&gt;&lt;LI&gt;Allow your input to adapt the &lt;FONT face="helvetica" size="2"&gt;&lt;STRONG&gt;ReportedDate&lt;/STRONG&gt;&lt;/FONT&gt; and &lt;FONT face="helvetica" size="2"&gt;&lt;STRONG&gt;ReportedTime&lt;/STRONG&gt;&lt;/FONT&gt; as separate &lt;EM&gt;String&lt;/EM&gt; value&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Use &lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;substring( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt; functions to slice values from these strings and append them to a new &lt;EM&gt;String&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Use a&lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;&lt;FONT size="4"&gt;&amp;nbsp;&lt;/FONT&gt;toDate( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt; function to cast the constructed &lt;EM&gt;String&lt;/EM&gt; value to a &lt;EM&gt;Date&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Use the &lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;currentOffsetUTC( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt; function to offset the constructed &lt;EM&gt;Date&lt;/EM&gt; from a local to a UTC standard value&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Write the result into a new attribute field whose data type is &lt;EM&gt;Date&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Example:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig10_CodeBlock.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65531i3419B06DF9FBFBA9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Fig10_CodeBlock.png" alt="Fig10_CodeBlock.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-align-right"&gt;&lt;FONT size="2"&gt;The&amp;nbsp;expression in the example presented above has been formatted within a code block for readability.&lt;BR /&gt;The expression should be entered as a single line of text into a&amp;nbsp;&lt;EM&gt;Field Calculator&lt;/EM&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="2"&gt;or Field Mapper processor.&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;FONT size="2"&gt;You can copy/paste the text shown&amp;nbsp; below:&lt;/FONT&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;toDate( substring( ReportedDate, 6, 10 ) + '-' + substring( ReportedDate, 0, 2 ) + '-' + substring( ReportedDate, 3, 5 ) + 'T' + substring( ReportedTime, 0, 2 ) + ':' + substring( ReportedTime, 3, 5 ) + ':' + substring( ReportedTime, 6, 8 ) + '-00:00' ) - currentOffsetUTC&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;()&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each &lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;substring( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt; function in the example slices a few characters out of the expression’s target field. For example, &lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;substring(ReportedDate, 6, 10)&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;slices the four characters '&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;2023&lt;/FONT&gt;&lt;/STRONG&gt;' from the reported date '&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;02/16/2023&lt;/FONT&gt;&lt;/STRONG&gt;'.&lt;BR /&gt;&lt;BR /&gt;The several &lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#800000"&gt;+&lt;/FONT&gt;&lt;/STRONG&gt; in the expression append substrings to one another. The '&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#339966"&gt;-&lt;/FONT&gt;&lt;/STRONG&gt;' in the expression are literal dash characters. Your goal is to construct the string:&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="helvetica" size="2"&gt;&lt;STRONG&gt;2023-02-16T18:37:15-00:00&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;&lt;EM&gt;&lt;FONT size="2" color="#333300"&gt;currentOffsetUTC( )&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt; function uses your machine’s locale to determine a millisecond offset from local time to UTC taking current Daylight Savings adjustments into account. The example said to assume the date and time are reported as local values so we&amp;nbsp;&lt;EM&gt;&lt;U&gt;subtract&lt;/U&gt;&lt;/EM&gt;&amp;nbsp;the current UTC offset to&amp;nbsp;shift the constructed &lt;EM&gt;Date&lt;/EM&gt; to a UTC standard consistent with the string’s time zone designation (the&amp;nbsp;'&lt;STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;-00:00&lt;/FONT&gt;&lt;/STRONG&gt;' we appended to the constructed ISO 8601 String). The UTC offset for regions in North America is&amp;nbsp;&lt;EM&gt;negative&lt;/EM&gt; as these time zones are several hours behind Greenwich Mean Time (GMT). Subtracting a negative value from the date/time effectively&amp;nbsp;&lt;EM&gt;adds&lt;/EM&gt; a number of hours to the value pushing it to a UTC standard time.&lt;/P&gt;&lt;P&gt;Appending a time zone designation '&lt;STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;-00:00&lt;/FONT&gt;&lt;/STRONG&gt;' is a better&amp;nbsp;approach than hard-coding an offset such as '&lt;STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;-07:00&lt;/FONT&gt;&lt;/STRONG&gt;' into the constructed string. Whatever constant you choose as the offset for a local time zone is likely only accurate during certain months of the year. Adjusting the date/time by adding the dynamic UTC offset takes your server's current Daylight Savings observation into account for you.&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;Reference:&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;A href="https://www.w3.org/TR/NOTE-datetime" target="_blank" rel="noopener"&gt;https://www.w3.org/TR/NOTE-datetime&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2023 00:45:32 GMT</pubDate>
    <dc:creator>RJSunderman</dc:creator>
    <dc:date>2023-03-17T00:45:32Z</dc:date>
    <item>
      <title>Timestamps received from a sensor feed display differently in GeoEvent Sampler, ArcGIS REST Services queries, and ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268748#M3917</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;EM&gt;This post was developed by Esri staff with the purpose of modeling real customer questions and positioning them with answers in a way that complements our users’ search processes.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="HorizontalLine.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65510i8BF613AC856AD781/image-size/large?v=v2&amp;amp;px=999" role="button" title="HorizontalLine.png" alt="HorizontalLine.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;We use Verizon Connect to track vehicles in our van pool in Cheyenne Wyoming. The clocks on our vehicles are set to Mountain Standard Time (MST) which is -7 hours relative to UTC.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;FONT color="#000000"&gt;When I use the GeoEvent Sampler to look at data from my input I see the date and time in MST, which is what I want. The data also appears to be in MST when I look at output I’ve written to a CSV file. Here are a couple of screenshots of what I’m seeing:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;FONT color="#000000"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Fig2_GeoEventSampler.png" style="width: 480px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65511i41A6444CAB301E2E/image-dimensions/480x288?v=v2" width="480" height="288" role="button" title="Fig2_GeoEventSampler.png" alt="Fig2_GeoEventSampler.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;FONT color="#000000"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Fig3_DelimitedTextOut.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65512i45FCF80F7A200D82/image-size/large?v=v2&amp;amp;px=999" role="button" title="Fig3_DelimitedTextOut.png" alt="Fig3_DelimitedTextOut.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;FONT color="#000000"&gt;When I look at feature records in the database the date and time look like they’ve been switched to an integer. When I open the feature record’s attribute table in ArcGIS Pro all of the values are offset 7 hours.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;FONT color="#000000"&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Fig5_RESTQuery_vs_ArcGIS_Pro.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65513iB6480359DEFC5728/image-size/large?v=v2&amp;amp;px=999" role="button" title="Fig5_RESTQuery_vs_ArcGIS_Pro.png" alt="Fig5_RESTQuery_vs_ArcGIS_Pro.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;FONT color="#000000"&gt;So, data coming into GeoEvent Server is MST but is somehow being changed when written to the database to switch it to UTC? Why is this happening and how do I fix it?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 20:14:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268748#M3917</guid>
      <dc:creator>RJSunderman</dc:creator>
      <dc:date>2023-03-16T20:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamps received from a sensor feed display differently in GeoEvent Sampler, ArcGIS REST Services queries, and ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268756#M3918</link>
      <description>&lt;P&gt;To answer your question we should first take a look at the raw data GeoEvent Server is receiving. The date/time values associated with sensor data are highly adaptable and can be represented many different ways. Your question mentions receiving data from Verizon Connect, so let’s look at some sample data from that sort of data feed.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Fig1_EpochConverterExample.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65514i5D000027D08A65C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Fig1_EpochConverterExample.png" alt="Fig1_EpochConverterExample.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The illustration above left shows a sample of raw JSON data typical of what Verizon Connect might send. Note the &lt;FONT size="2"&gt;&lt;STRONG&gt;UpdateUTC&lt;/STRONG&gt;&lt;/FONT&gt; data value is sent as a 13-digit epoch value in milliseconds. When a GeoEvent Server input receives data in this format and adapts it as a &lt;EM&gt;Date&lt;/EM&gt; the epoch value is assumed to represent a Coordinated Universal Time (&lt;A href="https://www.timeanddate.com/time/aboututc.html" target="_blank" rel="noopener"&gt;UTC&lt;/A&gt;) value, not a local time value such as Mountain Standard Time (&lt;A href="https://www.timeanddate.com/time/zones/mst" target="_blank" rel="noopener"&gt;MST&lt;/A&gt;). So to clarify a point in your question, data is &lt;EM&gt;&lt;U&gt;not&lt;/U&gt;&lt;/EM&gt; received as MST values. It is received as an epoch long integer value and adapted, first for processing as a &lt;EM&gt;Date&lt;/EM&gt; data type, and later for display as a string.&lt;/P&gt;&lt;P&gt;The second illustration, above right, shows an online date/time utility I often use to convert epoch long integer values to human-readable string representations of a given date and time. Note that the strings constructed by the utility specify an offset from Greenwich Mean Time (&lt;A href="https://www.timeanddate.com/time/zones/gmt" target="_blank" rel="noopener"&gt;GMT&lt;/A&gt;). GMT and UTC never change for&amp;nbsp;Daylight Saving Time&amp;nbsp;(&lt;A href="https://www.timeanddate.com/time/dst" target="_blank" rel="noopener"&gt;DST&lt;/A&gt;) and are sometimes used interchangeably even though GMT is technically a time zone and UTC is a time standard.&lt;/P&gt;&lt;P&gt;A display string constructed from the epoch &lt;FONT size="2"&gt;&lt;STRONG&gt;1676597835000&lt;/STRONG&gt;&lt;/FONT&gt; can specify a time zone. For example, an application might construct a string to display a date and time as &lt;FONT size="2"&gt;&lt;STRONG&gt;February 17th 1:37:15 AM (GMT)&lt;/STRONG&gt;&lt;/FONT&gt; or display a local time &lt;FONT size="2"&gt;&lt;STRONG&gt;February 16th 6:37:15 PM (MST)&lt;/STRONG&gt;&lt;/FONT&gt;. Note that when the epoch converter displays a local time value a time zone offset is included in the string.&lt;/P&gt;&lt;P&gt;Client applications generally determine how they want to construct and display string values representing a date and time. GeoEvent Server uses epoch long integer values for its &lt;EM&gt;Date&lt;/EM&gt; values when processing data, and at times converts the &lt;EM&gt;Date&lt;/EM&gt; into a human-readable string for display in the server’s local time zone.&lt;/P&gt;&lt;P&gt;To your original question, the &lt;FONT size="2"&gt;&lt;STRONG&gt;UpdateUTC&lt;/STRONG&gt;&lt;/FONT&gt; data value is not changed when written to the database. The &lt;EM&gt;Date&lt;/EM&gt; value in a geodatabase feature record is always going to be an epoch long integer value consistent with the &lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm#ESRI_SECTION1_B20F9637ADF04AD2B88172D43AA6FC42" target="_blank" rel="noopener"&gt;ArcGIS REST API&lt;/A&gt;. Verizon Connect sends the date/time of a vehicle position report as a UTC value, and that is how the value is being stored in the database.&lt;/P&gt;&lt;P&gt;Why a date/time value displayed by the GeoEvent Sampler appears different, for example, than the same value written out to a CSV file or a JSON file is a question of data adaptation and string construction. Rather than displaying the actual epoch long integer value of a &lt;EM&gt;Date&lt;/EM&gt; (such as &lt;FONT size="2"&gt;&lt;STRONG&gt;1676597835000&lt;/STRONG&gt;&lt;/FONT&gt;) GeoEvent Sampler constructs and displays a string representation of the &lt;EM&gt;Date&lt;/EM&gt; using your server’s locale to determine an appropriate time zone. That is why you see the time zone MST included in the GeoEvent Sampler’s displayed string "&lt;FONT size="2"&gt;&lt;STRONG&gt;Thu Feb 16 18:37:15 MST 2023&lt;/STRONG&gt;&lt;/FONT&gt;".&lt;/P&gt;&lt;P&gt;When you configure a &lt;EM&gt;Write to a CSV File&lt;/EM&gt; output you choose whether date/time values are written out as ISO 8601 formatted values or as strings in a custom format. The &lt;EM&gt;Write to a JSON File&lt;/EM&gt; output, on the other hand, cannot be configured to write out a human-readable string. When reviewing the JSON output file in a text editor you will see the actual epoch long integer value of a &lt;EM&gt;Date&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;I’ll include some examples in the comments below to illustrate how you might expect different client applications to construct display strings from epoch long integer values stored in a geodatabase feature record. But to answer the last part of your question, how do you fix what you are seeing, that depends entirely on what you are trying to do.&lt;/P&gt;&lt;P&gt;The epoch long integer underlying a &lt;EM&gt;Date&lt;/EM&gt; cannot express a time zone or an offset from UTC the way a &lt;EM&gt;String&lt;/EM&gt; value can. You could configure a &lt;EM&gt;Field Calculator&lt;/EM&gt; or &lt;EM&gt;Field Mapper&lt;/EM&gt; with an expression that either adds or subtracts a number of hours from a &lt;EM&gt;Date&lt;/EM&gt; value, but I really do not recommend this. If you fudge a &lt;EM&gt;Date&lt;/EM&gt; value to shift it from UTC into a local time zone you risk a client application downstream, possibly one outside the ArcGIS Enterprise, constructing a string from an epoch value it assumes is a UTC value and displaying a string which appears incorrect.&lt;/P&gt;&lt;P&gt;Suppose, for example, you are using an application like SQL Server Management Studio (SSMS). When the application retrieves a &lt;EM&gt;Date&lt;/EM&gt; whose value you have explicitly offset, it will likely assume the value it retrieved is a UTC value, use your server’s locale to determine an appropriate time zone, and apply the temporal offset a second time. The &lt;EM&gt;Date&lt;/EM&gt; value you explicitly offset by a number of hours as part of your event record processing in GeoEvent Server now appears incorrect when viewed using SSMS.&lt;/P&gt;&lt;P&gt;For the simple reason that a database server can be in any time zone, and web client applications that access the data may not be in the same time zone as the server, the recommended best practice is to keep the ArcGIS REST API default and allow feature services to maintain &lt;EM&gt;Date&lt;/EM&gt; values as epoch long integer values in the assumed UTC standard. If you want to calculate and store a local representation of a &lt;EM&gt;Date&lt;/EM&gt; value, calculate the value as a &lt;EM&gt;String&lt;/EM&gt;. You can use the &lt;EM&gt;toString( )&lt;/EM&gt; function in a &lt;EM&gt;Field Mapper&lt;/EM&gt;, for example, to do this.&lt;/P&gt;&lt;P&gt;A &lt;EM&gt;String&lt;/EM&gt; value is a literal string and won’t ever be manipulated to change its value. This might be ideal for displaying attribute values in a web map pop-up, but you cannot use attributes of type &lt;EM&gt;String&lt;/EM&gt; to configure something like the time slider in ArcGIS Pro. Instead of computing a &lt;EM&gt;String&lt;/EM&gt; value, or adding/subtracting a number of milliseconds from a &lt;EM&gt;Date&lt;/EM&gt; value, the best approach working with ArcGIS Pro would be to configure its feature layer properties to apply a time zone offset to &lt;EM&gt;Date&lt;/EM&gt; values it retrieves from a geodatabase. As you zoom, pan, and potentially change a map’s temporal extent to see more or fewer features, the date and time strings displayed by ArcGIS Pro should reflect local time rather than a UTC time.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 20:30:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268756#M3918</guid>
      <dc:creator>RJSunderman</dc:creator>
      <dc:date>2023-03-16T20:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamps received from a sensor feed display differently in GeoEvent Sampler, ArcGIS REST Services queries, and ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268758#M3919</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;Data from my sensor feed reports timestamp values in seconds rather than milliseconds. When these timestamps are converted to string values they display as dates in 1970. How do I fix this?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Some data feeds report date/time values as 10-digit epoch values measured in seconds. GeoEvent Server uses 13-digit millisecond values consistent with the ArcGIS REST API, so you have to multiply by 1000 to scale the value from seconds to milliseconds before writing it out to a geodatabase&lt;/P&gt;&lt;P&gt;To prevent an epoch such as &lt;FONT size="2"&gt;&lt;STRONG&gt;1676597835&lt;/STRONG&gt;&lt;/FONT&gt; from displaying as "&lt;STRONG&gt;&lt;FONT size="2"&gt;Tue Jan 20 02:43:17 MST 1970&lt;/FONT&gt;&lt;/STRONG&gt;":&lt;/P&gt;&lt;UL class="lia-list-style-type-circle"&gt;&lt;LI&gt;Allow your input to adapt the 10-digit epoch value as either a &lt;EM&gt;Date&lt;/EM&gt; or a &lt;EM&gt;Long&lt;/EM&gt; integer value&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Use a &lt;EM&gt;Field Calculator&lt;/EM&gt; or &lt;EM&gt;Field Mapper&lt;/EM&gt; to scale the &lt;FONT size="2"&gt;&lt;STRONG&gt;ReportedDT&lt;/STRONG&gt;&lt;/FONT&gt; attribute value from seconds to milliseconds&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Use &lt;SPAN&gt;a&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;&lt;FONT size="4"&gt;&amp;nbsp;&lt;/FONT&gt;toDate( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;function&lt;/SPAN&gt;&amp;nbsp;to explicitly cast the arithmetic result from an implicit &lt;EM&gt;Long&lt;/EM&gt; to a &lt;EM&gt;Date&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier" size="2"&gt;toDate(ReportedDT * 1000)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 21:34:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268758#M3919</guid>
      <dc:creator>RJSunderman</dc:creator>
      <dc:date>2023-03-16T21:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamps received from a sensor feed display differently in GeoEvent Sampler, ArcGIS REST Services queries, and ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268767#M3920</link>
      <description>&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Data from my sensor feed reports the date and time of each data record in separate fields. How do I combine these into a single Date attribute?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Use a &lt;EM&gt;Field Calculator&lt;/EM&gt; or &lt;EM&gt;Field Mapper&lt;/EM&gt; to combine the date and time values into a string which GeoEvent Server can interpret as a &lt;EM&gt;Date&lt;/EM&gt;. Your goal is to construct a single ISO 8601 formatted string that contains both the date and time values which you can then cast from &lt;EM&gt;String&lt;/EM&gt; to &lt;EM&gt;Date&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;For this example assume that &lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;ReportedDate&lt;/FONT&gt;&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;ReportedTime&lt;/FONT&gt;&lt;/STRONG&gt; hold the values "&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;02/16/2023&lt;/FONT&gt;&lt;/STRONG&gt;" and "&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;18:37:15&lt;/FONT&gt;&lt;/STRONG&gt;" respectively. Assume that the date and time are reported as local values, so a dynamic UTC offset should be applied to avoid errors when clocks are adjusted for Daylight Savings twice each year.&lt;/P&gt;&lt;P&gt;The string you are calculating for this example&amp;nbsp;&lt;SPAN&gt;should be:&amp;nbsp;&amp;nbsp;&lt;FONT face="helvetica" size="2"&gt;&lt;STRONG&gt;2023-02-16T18:37:15-00:00&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL class="lia-list-style-type-circle"&gt;&lt;LI&gt;Allow your input to adapt the &lt;FONT face="helvetica" size="2"&gt;&lt;STRONG&gt;ReportedDate&lt;/STRONG&gt;&lt;/FONT&gt; and &lt;FONT face="helvetica" size="2"&gt;&lt;STRONG&gt;ReportedTime&lt;/STRONG&gt;&lt;/FONT&gt; as separate &lt;EM&gt;String&lt;/EM&gt; value&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Use &lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;substring( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt; functions to slice values from these strings and append them to a new &lt;EM&gt;String&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Use a&lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;&lt;FONT size="4"&gt;&amp;nbsp;&lt;/FONT&gt;toDate( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt; function to cast the constructed &lt;EM&gt;String&lt;/EM&gt; value to a &lt;EM&gt;Date&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Use the &lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;currentOffsetUTC( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt; function to offset the constructed &lt;EM&gt;Date&lt;/EM&gt; from a local to a UTC standard value&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Write the result into a new attribute field whose data type is &lt;EM&gt;Date&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Example:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig10_CodeBlock.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65531i3419B06DF9FBFBA9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Fig10_CodeBlock.png" alt="Fig10_CodeBlock.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="lia-align-right"&gt;&lt;FONT size="2"&gt;The&amp;nbsp;expression in the example presented above has been formatted within a code block for readability.&lt;BR /&gt;The expression should be entered as a single line of text into a&amp;nbsp;&lt;EM&gt;Field Calculator&lt;/EM&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="2"&gt;or Field Mapper processor.&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;FONT size="2"&gt;You can copy/paste the text shown&amp;nbsp; below:&lt;/FONT&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;toDate( substring( ReportedDate, 6, 10 ) + '-' + substring( ReportedDate, 0, 2 ) + '-' + substring( ReportedDate, 3, 5 ) + 'T' + substring( ReportedTime, 0, 2 ) + ':' + substring( ReportedTime, 3, 5 ) + ':' + substring( ReportedTime, 6, 8 ) + '-00:00' ) - currentOffsetUTC&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;()&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each &lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;substring( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt; function in the example slices a few characters out of the expression’s target field. For example, &lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;substring(ReportedDate, 6, 10)&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;slices the four characters '&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;2023&lt;/FONT&gt;&lt;/STRONG&gt;' from the reported date '&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;02/16/2023&lt;/FONT&gt;&lt;/STRONG&gt;'.&lt;BR /&gt;&lt;BR /&gt;The several &lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#800000"&gt;+&lt;/FONT&gt;&lt;/STRONG&gt; in the expression append substrings to one another. The '&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#339966"&gt;-&lt;/FONT&gt;&lt;/STRONG&gt;' in the expression are literal dash characters. Your goal is to construct the string:&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="helvetica" size="2"&gt;&lt;STRONG&gt;2023-02-16T18:37:15-00:00&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;&lt;EM&gt;&lt;FONT size="2" color="#333300"&gt;currentOffsetUTC( )&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt; function uses your machine’s locale to determine a millisecond offset from local time to UTC taking current Daylight Savings adjustments into account. The example said to assume the date and time are reported as local values so we&amp;nbsp;&lt;EM&gt;&lt;U&gt;subtract&lt;/U&gt;&lt;/EM&gt;&amp;nbsp;the current UTC offset to&amp;nbsp;shift the constructed &lt;EM&gt;Date&lt;/EM&gt; to a UTC standard consistent with the string’s time zone designation (the&amp;nbsp;'&lt;STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;-00:00&lt;/FONT&gt;&lt;/STRONG&gt;' we appended to the constructed ISO 8601 String). The UTC offset for regions in North America is&amp;nbsp;&lt;EM&gt;negative&lt;/EM&gt; as these time zones are several hours behind Greenwich Mean Time (GMT). Subtracting a negative value from the date/time effectively&amp;nbsp;&lt;EM&gt;adds&lt;/EM&gt; a number of hours to the value pushing it to a UTC standard time.&lt;/P&gt;&lt;P&gt;Appending a time zone designation '&lt;STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;-00:00&lt;/FONT&gt;&lt;/STRONG&gt;' is a better&amp;nbsp;approach than hard-coding an offset such as '&lt;STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;-07:00&lt;/FONT&gt;&lt;/STRONG&gt;' into the constructed string. Whatever constant you choose as the offset for a local time zone is likely only accurate during certain months of the year. Adjusting the date/time by adding the dynamic UTC offset takes your server's current Daylight Savings observation into account for you.&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;Reference:&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;A href="https://www.w3.org/TR/NOTE-datetime" target="_blank" rel="noopener"&gt;https://www.w3.org/TR/NOTE-datetime&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 00:45:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268767#M3920</guid>
      <dc:creator>RJSunderman</dc:creator>
      <dc:date>2023-03-17T00:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamps received from a sensor feed display differently in GeoEvent Sampler, ArcGIS REST Services queries, and ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268774#M3921</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;Data from my sensor feed reports timestamp values which look like the ISO 8601 format, but &lt;EM&gt;Date&lt;/EM&gt; values converted to a string display with an offset hours ahead of the local time reported in the feed. Why is this happening?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Sometimes the date/time strings sent from a data provider appear to follow ISO 8601 formatting rules, but they are missing a time zone designator or the literal ‘T’ between the date and time values. To answer your question we should first confirm that the raw data being received &lt;EM&gt;&lt;U&gt;actually&lt;/U&gt;&lt;/EM&gt; follows the ISO 8601 standard.&lt;/P&gt;&lt;P&gt;For this example assume:&lt;BR /&gt;&amp;nbsp; &amp;nbsp;a)&amp;nbsp; The sensor feed's specification indicates that&amp;nbsp;&lt;FONT size="2"&gt;&lt;STRONG&gt;ReportedDT&lt;/STRONG&gt;&lt;/FONT&gt; is sent&amp;nbsp;as a local time value&lt;BR /&gt;&amp;nbsp; &amp;nbsp;b)&amp;nbsp; The&amp;nbsp;&lt;FONT size="2"&gt;&lt;STRONG&gt;ReportedDT&lt;/STRONG&gt;&lt;/FONT&gt; string value&amp;nbsp;&lt;SPAN&gt;"&lt;STRONG&gt;&lt;FONT size="2"&gt;2023-02-10T11:45:00&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;" is being received&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The date/time value being sent by the data feed does not include a time zone designation. You can apply a dynamic UTC offset based on your server’s observed time zone as part of a &lt;EM&gt;Field Calculator&lt;/EM&gt; or &lt;EM&gt;Field Mapper&lt;/EM&gt; expression to fix this.&lt;/P&gt;&lt;UL class="lia-list-style-type-circle"&gt;&lt;LI&gt;Allow your input to adapt the &lt;FONT size="2"&gt;&lt;STRONG&gt;ReportedDT&lt;/STRONG&gt;&lt;/FONT&gt; string value as a &lt;EM&gt;Date&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Use &lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;currentOffsetUTC( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;to offset the adapted &lt;EM&gt;Date&lt;/EM&gt; from its local value to a UTC standard value&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Cast&amp;nbsp;&amp;nbsp;the result of the calculation to a &lt;EM&gt;Date&lt;/EM&gt; (the arithmetic calculation returns a &lt;EM&gt;Long&lt;/EM&gt;, not a &lt;EM&gt;Date&lt;/EM&gt;)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier" size="2"&gt;toDate(ReportedDT - currentOffsetUTC())&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The feed's value really ought to include a time zone designator to indicate in which time zone the date/time is being reported.&amp;nbsp;It would be the feed’s responsibility to automatically adjust the time zone designation in data it sends when clocks change for Daylight Savings twice each year. If no offset were being applied the &lt;SPAN&gt;time zone designation should be '&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;-00:00&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt;' to&lt;/SPAN&gt; indicate the date/time is a UTC value.&lt;/P&gt;&lt;P&gt;The data provider’s specification, in this example, supposedly says that the date and time values are consistent with a local time zone. Applications which adapt an ISO 8601 formatted string which is missing a time zone designator are free to assume a time zone. GeoEvent Server assumes the date/time is a UTC value when adapting an ISO 8601 formatted string. The current UTC offset is therefore&amp;nbsp;&lt;EM&gt;&lt;U&gt;subtracted&lt;/U&gt;&lt;/EM&gt; from the reported date/time to shift the value from what the feed specification says is a local time to the UTC standard assumed by GeoEvent Server. The value returned by the &lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;currentOffsetUTC( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;function&lt;/SPAN&gt;&amp;nbsp;is negative for areas in North America. Subtracting a negative value effectively adds a number of hours to the &lt;EM&gt;Date&lt;/EM&gt; shifting it forward to a UTC standard time.&lt;/P&gt;&lt;P&gt;You might think to fix the &lt;FONT size="2"&gt;&lt;STRONG&gt;ReportedDT&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;value by adapting it as a &lt;EM&gt;String&lt;/EM&gt; and then appending a time zone designator yourself to the string. If you do, twice each year when clocks are adjusted for Daylight Savings, the time zone designator you append to the received string would require update. So it is better to use the dynamic UTC offset provided by the &lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;currentOffsetUTC( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;function&lt;/SPAN&gt;&amp;nbsp;in this case.&lt;/P&gt;&lt;P&gt;Remember, &lt;EM&gt;Date&lt;/EM&gt; values in a geodatabase are maintained as epoch long integer values which by convention are assumed to be UTC values. As a best practice you want to write UTC values to your geodatabase and allow client applications to determine how they want to construct a string representation of an assumed UTC value they retrieve as part of a feature record&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;Reference:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.w3.org/TR/NOTE-datetime" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.w3.org/TR/NOTE-datetime&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 23:02:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268774#M3921</guid>
      <dc:creator>RJSunderman</dc:creator>
      <dc:date>2023-03-16T23:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamps received from a sensor feed display differently in GeoEvent Sampler, ArcGIS REST Services queries, and ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268806#M3922</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;Does GeoEvent Server have a preferred string format for date and time values?&amp;nbsp; When is a value for the &lt;EM&gt;Expected Date Format&lt;/EM&gt; parameter required and when can I leave it unspecified?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;GeoEvent Server is able to adapt a variety of different string formats without relying on a custom string formatting pattern specified using the &lt;EM&gt;Expected Date Format&lt;/EM&gt; parameter. The preferred format for date/time values is the ISO 8601 format with a time zone designator, but either of the following two string formats are preferable to other options:&lt;/P&gt;&lt;UL class="lia-list-style-type-circle"&gt;&lt;LI&gt;"&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;2023-02-21T14:36:45-08:00&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/LI&gt;&lt;LI&gt;"&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;Tue Feb 21 14:36:45 PST 2023&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The first formatted string is an example of the ISO 8601 standard.&lt;BR /&gt;The second is an example of the format Java uses when converting a &lt;EM&gt;Date&lt;/EM&gt; to a &lt;EM&gt;String&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;Notice that both of the examples above designate the date and time values are in the &lt;EM&gt;Pacific Time Zone&lt;/EM&gt;. GeoEvent Server is able to adapt either string to produce a &lt;EM&gt;Date&lt;/EM&gt; without relying on a specific &lt;EM&gt;Expected Date Format&lt;/EM&gt; pattern. The underlying epoch used for event record processing and the long integer value written to a geodatabase as a feature record’s &lt;EM&gt;Date&lt;/EM&gt; will be the same (&lt;FONT face="helvetica" size="2"&gt;&lt;STRONG&gt;1677019005000&lt;/STRONG&gt;&lt;/FONT&gt;) regardless of the server locale or clock setting when adapting either formatted string.&lt;/P&gt;&lt;P&gt;GeoEvent Server inputs can adapt other string formats as &lt;EM&gt;Date&lt;/EM&gt; values when a GeoEvent Definition specifies the event record attribute should be handled as a &lt;EM&gt;Date&lt;/EM&gt; rather than a &lt;EM&gt;String&lt;/EM&gt;. Each of the following formatted string values will also adapt successfully, without requiring an &lt;EM&gt;Expected Date Format&lt;/EM&gt; pattern, but the underlying epoch will depend on the locale and clock setting of the server.&lt;/P&gt;&lt;UL class="lia-list-style-type-circle"&gt;&lt;LI&gt;"&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;02/21/23 02:36:45 PM&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/LI&gt;&lt;LI&gt;"&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;02/21/23 14:36:45&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/LI&gt;&lt;LI&gt;"&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;02/21/2023 02:36:45 PM&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/LI&gt;&lt;LI&gt;"&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;02/21/2023 14:36:45&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;None of the four date/time strings above specify a time zone, so GeoEvent Server has to assume one when adapting the formatted strings and calculating a &lt;EM&gt;Date&lt;/EM&gt;. The string values will be adapted as local date/time values. The epoch long integer value assigned to the constructed&amp;nbsp;&lt;EM&gt;Date&lt;/EM&gt; will be a UTC date/time offset from the server’s local time by the appropriate number of hours. &lt;EM&gt;&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;This means that different servers in different time zones will compute different epoch values.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Consider the example below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DateTimeToEpoch.png" style="width: 609px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65518iF5CC1A6577383571/image-dimensions/609x70?v=v2" width="609" height="70" role="button" title="DateTimeToEpoch.png" alt="DateTimeToEpoch.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The epoch calculated by a server observing ‘Pacific Time’ will be +03:00 hours relative to the epoch calculated by a server that observes ‘Eastern Time’ even though both server machines presumably received and adapted the same formatted string from the same data feed. If the date/time string sent by the feed included a time zone designator GeoEvent Server would not presume to use the server’s observed time zone and the epoch computed by each server would be the same.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;Timestamp values with only “hours” and “minutes”&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;GeoEvent Server inputs are able to adapt string timestamps from data feeds which include only “hours” and “minutes” in the formatted string value.&lt;/P&gt;&lt;UL class="lia-list-style-type-circle"&gt;&lt;LI&gt;"&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;02/21/23 14:36&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/LI&gt;&lt;LI&gt;"&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;02/21/2023 14:36&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The server’s calculated epoch will, of course, be 45 seconds earlier than the ‘Pacific Time’ epoch shown in the previous example (&lt;FONT face="helvetica" size="2"&gt;&lt;STRONG&gt;1677018960000&lt;/STRONG&gt;&lt;/FONT&gt; rather than &lt;FONT face="helvetica" size="2"&gt;&lt;STRONG&gt;1677019005000&lt;/STRONG&gt;&lt;/FONT&gt;) since the reported time does not include ‘seconds’.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;Specifying an Expected Date Format pattern string&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;You only need to configure an input with an Expected Date Format pattern string if strings being received and adapted as &lt;EM&gt;Date&lt;/EM&gt; values deviate from the examples above. An example frequently encountered includes date/time values on the European continent which specify the day before the month (e.g. &lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;21/02/2023&lt;/FONT&gt;&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;In this case you would need to specify a date format pattern &lt;FONT face="courier new,courier" color="#993300"&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;dd/MM/yyyy hh:mm:ss&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; for GeoEvent Server to use when parsing the date string. The pattern specified uses the standard Java conventions for date/time strings. The &lt;A href="http://www.sdfonlinetester.info" target="_self"&gt;Java SimpleDateFormat Tester&lt;/A&gt; is on online utility you can use to explore Java’s conventions.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#3366FF"&gt;&lt;BR /&gt;Example: Receiving a UTC time which does not include a time zone designator&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Suppose you want an input to adapt the formatted date/time string "&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;February 28, 2023 21:36:45&lt;/FONT&gt;&lt;/STRONG&gt;" reported by a sensor feed. The feed’s specification indicates that timestamps on each record are UTC values, but looking at the data you recognize that the formatted string uses the proper name for the month rather than a numeric value, includes a comma, and does not include a time zone designator. You therefore configure your GeoEvent Server input with an&amp;nbsp;&lt;EM&gt;Expected Date Format&lt;/EM&gt; pattern&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier" color="#993300"&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;MMM dd, yyyy HH:mm:ss&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;to instruct GeoEvent Server how the custom string format should be interpreted.&lt;/P&gt;&lt;P&gt;The feed's specification indicates that date/time values are reported as UTC values, so you should also use &lt;SPAN&gt;the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;currentOffsetUTC( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;function&lt;/SPAN&gt; to add your server's current UTC offset to the adapted date/time.&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier" size="2"&gt;toDate(ReportedDT + currentOffsetUTC()&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The epoch you want to compute and assign to your geodatabase feature records is:&amp;nbsp; &lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;1677620205000&lt;/FONT&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Fig9_Calculated_UTC_Values.png" style="width: 633px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65529iAD7C40D8B03A20ED/image-dimensions/633x266?v=v2" width="633" height="266" role="button" title="Fig9_Calculated_UTC_Values.png" alt="Fig9_Calculated_UTC_Values.png" /&gt;&lt;/span&gt;&lt;BR /&gt;In an earlier example I indicated that&amp;nbsp;&lt;SPAN&gt;GeoEvent Server assumes a date/time expressed in the ISO 8601 format&amp;nbsp;is a UTC value when adapting the string. In this case&amp;nbsp;GeoEvent Server assumes the opposite. The custom date/time format "&lt;STRONG&gt;&lt;FONT face="helvetica" size="2"&gt;February 28, 2023 21:36:45&lt;/FONT&gt;&lt;/STRONG&gt;" follows no particular standard, so GeoEvent Server assumes that it represents a local value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The current UTC offset is &lt;EM&gt;&lt;U&gt;added&lt;/U&gt;&lt;/EM&gt;&amp;nbsp;to the reported date/time in this case because the feed's specification said each record's timestamp is a UTC value and GeoEvent Server assumed the opposite. It&amp;nbsp;checked the server's locale and applied an assumed offset based on the time zone observed by the server when adapting the formatted string as a &lt;EM&gt;Date&lt;/EM&gt;. Time zones i&lt;SPAN&gt;n North America &lt;/SPAN&gt;&lt;SPAN&gt;are several hours behind Greenwich Mean Time (GMT)&lt;/SPAN&gt;&amp;nbsp;so GeoEvent Server would add some number of hours to push an assumed local value to a UTC standard value.&lt;/P&gt;&lt;P&gt;The value&amp;nbsp;returned by the&amp;nbsp;&lt;STRONG&gt;&lt;FONT size="2" color="#333300"&gt;&lt;EM&gt;currentOffsetUTC( )&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt; function in negative (in North America) so adding the value to the date/time effectively rolls back the offset applied when the data value was adapted.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 00:11:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/timestamps-received-from-a-sensor-feed-display/m-p/1268806#M3922</guid>
      <dc:creator>RJSunderman</dc:creator>
      <dc:date>2023-03-17T00:11:49Z</dc:date>
    </item>
  </channel>
</rss>

