<?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: Converting between Date Formats in ArcGIS GeoEvent Server Questions</title>
    <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/1030117#M3479</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/115391"&gt;@RJSunderman&lt;/a&gt;&amp;nbsp;/ &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/62875"&gt;@ThomasPaschke&lt;/a&gt;&amp;nbsp;&amp;nbsp;I have been encountering a slightly different issue. A couple of fields in my CSV file only have 'date' values in them, no time i.e. in MM/DD/YYYY format. However, The geoevent processor brings them in as 'MM/DD/YYYY 4 PM' format in the feature service. I guess the default 4 PM gets added because of the UTC conversion. How can I remove the aforementioned 4 PM from my values?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2021 18:34:30 GMT</pubDate>
    <dc:creator>Ctal_GISsquad</dc:creator>
    <dc:date>2021-02-24T18:34:30Z</dc:date>
    <item>
      <title>Converting between Date Formats</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73756#M331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an &lt;/SPAN&gt;&lt;A href="http://pipes.yahoo.com/pipes/pipe.run?_id=7892c39c1778e81c27aeb4a0ba265623&amp;amp;_render=json" rel="nofollow noopener noreferrer" target="_blank"&gt;incoming feed&lt;/A&gt;&lt;SPAN&gt; which has a &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;LastSampleTime&lt;/SPAN&gt;&lt;SPAN&gt;.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This comes into GEP and by default creates a &lt;/SPAN&gt;&lt;STRONG&gt;string&lt;/STRONG&gt;&lt;SPAN&gt; field in the GeoEvent Defintion.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;1. Incoming Date as a String Field:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;"25/06/2014 12:45:00"&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I alter the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;LastSampleTime&lt;/SPAN&gt;&lt;SPAN&gt; in the GeoEvent Definition to be a date:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;2. Incoming Date as a Date Field:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;'06/25/2014 12:00:00 AM'&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;- It makes all the times to be 12:00:00 AM, which is incorrect as the times vary on the incoming stream.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a feature service hosted on ArcGIS Online, and I have the rest of the feed readings updating the relevant fields on this service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As it is ArcGIS Online, I have no control over the underlying DBMS in regards to any settings around date formats.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For the date field, if I pass the date as a date (#2 above), then this gets written to the feature fine.&amp;nbsp; However, unless I can find a way to ensure the time is correct, this is not going to be an option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I try and pass the date as a string, then it won't work.&amp;nbsp; This makes sense, as if I try and do an ApplyEdits using the string directly against the REST endpoint, then it fails:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;Fails:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is using the same date (string) that I am getting off the feed:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp; "attributes" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "OBJECTID" : 1,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "LastSampleTime" : &lt;STRONG&gt;'25/06/2014 12:45:00'&lt;/STRONG&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Error: 1000, Description: Conversion failed when converting date and/or time from character string.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What does work, is if it convert the date into a different format:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;Successful: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "attributes" : {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "OBJECTID" : 1,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "LastSampleTime" :&lt;/SPAN&gt;&lt;STRONG&gt; '2014-06-25 12:45:00'&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;= Edits applied ok!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was pondering having a play with a regular expression to try and convert the original date into a date string that works, but sounds like the wrong way to do it.&amp;nbsp; I dont think there are any function expressions that convert dates into different formats.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please, some advice on how to go about getting the correct date &amp;amp; timestamp from the incoming feed into GEP would really help me out.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:52:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73756#M331</guid>
      <dc:creator>SimonJackson</dc:creator>
      <dc:date>2021-12-10T22:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Converting between Date Formats</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73757#M332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Simon -&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Generally speaking the out-of-the-box processors and adapters make a good faith attempt to convert data not presented in the ISO 8601 format, which looks like a date/time value, into a Date type object ... when the GeoEvent Definition specifies that a particular event field should be interpreted as a Date.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because the yahoo feed you referenced is passing its LastSampleTime as a quoted value, GeoEvent Processor will assume that the event field should be treated as a String ... so your initial assumption to modify the generated event definition to handle the LastSampleTime field as a Date type was correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But there's one more step you have to take. Since the date/time is being supplied in an "international" format with the days value coming before the month value. In the inbound connector's configuration ... I was using a 'Poll an external website for JSON' input ... you need to specify a date/time mask.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Expand the connector's Advanced properties and enter the following for the 'Expected Date Format': &lt;/SPAN&gt;&lt;STRONG&gt;dd/MM/yyyy hh:mm:ss&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This tells GEP to expect that &lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt; field of type Date should be parsed as days, months, years, hours, minutes, seconds with literal '/' between the date values and literal ':' between the time values -- rather than the American custom of months, days, years, hours, minutes, seconds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, because the provided date/time string does not include any time zone information, the GEP will assume that the received date/time is in the same time zone as the server processing the data. On my machine here in California the feed's provided value "30/06/2014 11:45:00" was parsed as June 30th 2014 at 11:45:00 AM, which is equivalent to Mon, 30 Jun 2014 18:45:00 GMT. When I push the GeoEvents into a GeoEvent cache and request a JSON representation of the event data, this is what I get:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; "Site": "210135-Brickmans Bdg",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "LastSampleTime": 1404153900000,
&amp;nbsp;&amp;nbsp;&amp;nbsp; "RiverLevel": "1.123",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "FlowRate": "5.3",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "RainfallIntensity": " ",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "WaterTemp": " ",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "Conductivity": " "
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The long integer, of course, is the GMT value of the date/time represented as milliseconds since the epoch ... consistent with the Esri Feature Services REST API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you know, the out-of-the-box text adapter can create a text representation of this value, but it will automatically shift the value to your server's current time zone (e.g. 11:45:00 AM). If you need to, you can use a Field Calculator to add/subtract a number of milliseconds to shift the GeoEvent's UTC value from Zulu/GMT to Lima/Localtime, then use a Field Mapper to create a String representation of the value: "Mon Jun 30 11:45:00 PDT 2014". From there, if you really need report dd/mm/yyyy hh:mm:ss ... you'll have to use string functions to manipulate the string representation of the date/time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this information helps -&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RJ&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 15:59:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73757#M332</guid>
      <dc:creator>RJSunderman</dc:creator>
      <dc:date>2021-12-12T15:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Converting between Date Formats</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73758#M333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;RJ - really appreciate you taking the time to provide such detailed answers, really helps me (and I imagine others who may stumble upon this thread) get a better understanding on how to configure GeoEvent services.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not had time to apply the above yet, but it makes perfect sense, was unaware there was expected date format settings for the Poll URL for JSON input connector.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 12:40:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73758#M333</guid>
      <dc:creator>SimonJackson</dc:creator>
      <dc:date>2014-06-30T12:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Converting between Date Formats</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73759#M334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a similar problems with GEP and dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the date and time in to different fields, and uses a Field Calculator to combine it in a string field, but when I try to update my feature class (using a field mapper between the calculated new date string and my FC date filed) the date field is not updated. My format is &lt;SPAN style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;yyyy-mm-dd hh:mm:ss, I've also tried dd/mm/yyyy &lt;SPAN style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;hh:mm:ss, but non is working.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;And aslo, when I'm using GeoNet it seems like all replies from Esri Staff disappears?!? This is really frustrating, and means that 90% of the solutions of threads are gone for me, I can't se any replies from "RJ" in any threads.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;Sindre Engh&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;Geodata Norway&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 09:39:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73759#M334</guid>
      <dc:creator>SindreEngh</dc:creator>
      <dc:date>2014-10-15T09:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Converting between Date Formats</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73760#M335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;Hi &lt;SPAN&gt;Sindre&lt;/SPAN&gt;,&lt;BR /&gt;&lt;BR /&gt;we are aware of the issue that all posts of RJ got lost while migrating from the old forum to &lt;SPAN&gt;GeoNet&lt;/SPAN&gt; and working on a fix to recover his posts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-autospace:none;"&gt;Regarding your problem: Please try to use the ISO 8601 format (&lt;SPAN style="font-size:10.0pt;font-family: Segoe UI , sans-serif;"&gt;&lt;A href="http://www.w3.org/TR/NOTE-datetime"&gt;http://www.w3.org/TR/NOTE-datetime&lt;/A&gt;&lt;/SPAN&gt;), which is for your case &lt;SPAN&gt;YYYY-MM-DDThh:mm:ss&lt;/SPAN&gt;. &lt;/P&gt;&lt;P style="text-autospace:none;"&gt;We make a good afford to convert different date/time formats received by the input text adapter into the Epoch format (long) in order to use them for further &lt;SPAN&gt;GeoEvent&lt;/SPAN&gt; processing. However, if you want to convert a string into a date field after it past the input text adapter (e.g. using a processor like the field mapper) only the very strict time formats of ISO 8601 are supported. &lt;/P&gt;&lt;P style="text-autospace:none;"&gt;&lt;/P&gt;&lt;P style="text-autospace:none;"&gt;I hope this helps, let me know if you need any further assistance.&lt;/P&gt;&lt;P style="text-autospace:none;"&gt;&lt;/P&gt;&lt;P style="text-autospace:none;"&gt;Best,&lt;/P&gt;&lt;P style="text-autospace:none;"&gt;Thomas&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 22:40:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73760#M335</guid>
      <dc:creator>ThomasPaschke</dc:creator>
      <dc:date>2014-10-20T22:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Converting between Date Formats</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73761#M336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the detailed reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found out that the format YYYY-MM-DDThh:mm:ssZ did work, so adding a 'T' between the date and time and a 'Z' at the end of the time did the trick. My Field Calculatoer ended up looking like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'20' + substring(date,4,6)+ '-' + substring(date,2,4) + '-' + substring(date,0,2) + 'T' + substring(UTC_time,0,2) + ':' + substring(UTC_time,2,4) + ':' + substring(UTC_time,4,6)+'Z' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date = "DDMMYY"&lt;/P&gt;&lt;P&gt;UTC_time = ""hhmmss"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sindre&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 11:41:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/73761#M336</guid>
      <dc:creator>SindreEngh</dc:creator>
      <dc:date>2014-10-21T11:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Converting between Date Formats</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/1030117#M3479</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/115391"&gt;@RJSunderman&lt;/a&gt;&amp;nbsp;/ &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/62875"&gt;@ThomasPaschke&lt;/a&gt;&amp;nbsp;&amp;nbsp;I have been encountering a slightly different issue. A couple of fields in my CSV file only have 'date' values in them, no time i.e. in MM/DD/YYYY format. However, The geoevent processor brings them in as 'MM/DD/YYYY 4 PM' format in the feature service. I guess the default 4 PM gets added because of the UTC conversion. How can I remove the aforementioned 4 PM from my values?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 18:34:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/1030117#M3479</guid>
      <dc:creator>Ctal_GISsquad</dc:creator>
      <dc:date>2021-02-24T18:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Converting between Date Formats</title>
      <link>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/1031228#M3484</link>
      <description>&lt;P&gt;If data you are receiving contains only a date value (e.g.&amp;nbsp; 12/31/2021 ) without a time, this is not a pattern GeoEvent Server recognizes without you specifying a&amp;nbsp;an&amp;nbsp;&lt;EM&gt;Expected Date Format&lt;/EM&gt;&amp;nbsp;the inbound adapter can use to figure out how to parse a String as a Date. You would have to specify a value like&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;MM/dd/yyyy&lt;/STRONG&gt;&lt;/EM&gt; when configuring your inbound connector. The connector will apply this pattern to all event record attributes whose data type is Date in the GeoEvent Definition used by the inbound connector.&lt;/P&gt;&lt;P&gt;When I send the String value &lt;STRONG&gt;"12/31/2021"&lt;/STRONG&gt;&amp;nbsp;to my GeoEvent Server with the &lt;EM&gt;Expected Date Format&amp;nbsp;&lt;/EM&gt;configuration described above, the Date value my inbound adapter constructs for me from the received string is&amp;nbsp;&lt;STRONG&gt;1640937600000&lt;/STRONG&gt;. This is an &lt;A href="https://www.epoch101.com/Java" target="_self"&gt;epoch value&lt;/A&gt; used by Java to represent date/time values. GeoEvent Server uses millisecond epoch values, which is why the value has 13 digits rather than only 10.&lt;/P&gt;&lt;P&gt;If I ask GeoEvent Sever to cast its&amp;nbsp;&lt;EM&gt;Date&lt;/EM&gt; to a String I get a representation of the date which looks like&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#993300"&gt;"Fri Dec 31 00:00:00 PST 2021"&lt;/FONT&gt;&lt;/STRONG&gt;.&amp;nbsp; Notice that the string has both a "date" and a "time" and includes the&amp;nbsp;&lt;U&gt;Time Zone&lt;/U&gt; for the expressed date/time value. In this case, the&amp;nbsp;&lt;EM&gt;Date&lt;/EM&gt; is expressed in the Pacific time zone. This is&amp;nbsp;because an&amp;nbsp;&lt;EM&gt;Expected Date Format&lt;/EM&gt; pattern was specified -- which is required to handle the inbound string which does not match one of the few built-in expected patterns for a date/time value.&amp;nbsp;The time zone handling is important to note because, in this case, the date/time is&amp;nbsp;&lt;EM&gt;&lt;U&gt;not&lt;/U&gt;&lt;/EM&gt; in UTC units. GeoEvent Server assumes that the non-standard date/time must be a date/time local to my solution, so it uses the locale of my server (whose clock is configured to use the Pacific Time Zone).&lt;/P&gt;&lt;P&gt;Focusing on your question, if you are receiving a string value which is somehow being adapted to produce the epoch date value&amp;nbsp;1640908800000 (which could also be represented as "Thursday, December 30, 2021 4:00:00 PM GMT-08:00" or "Thu Dec 30 16:00:00 PST 2021") and you need to truncate the value to be simply "Thursday, December 30" ... you have a couple of options.&lt;/P&gt;&lt;P&gt;I strongly recommend you make sure you understand how the received data is actually being adapted, and check to verify how client applications are representing the value in web map pop-ups or web forms. A client application will likely represent a Java Epoch date/time value it receives, when querying a feature service for feature records for example, in whatever time zone the client web application is running.&amp;nbsp;The value&amp;nbsp;1640908800000 already represents the date/time "&lt;SPAN&gt;Friday, December 31, 2021 12:00:00 AM&lt;/SPAN&gt;" when a UTC value is assumed and web clients are likely going to try and represent an assumed UTC date/time in whatever time zone the web application is running.&lt;/P&gt;&lt;P&gt;If you were to add or subtract some number of milliseconds from the epoch to drop the "time" portion and keep only the whole "date" value, your effort is likely going to have unintended consequences client-side.&lt;/P&gt;&lt;P&gt;You could use a RegEx pattern match on a value toString(myDate) to isolate the whole hours portion of the "time" and then multiply this by 3,600,000 (which is 60 min x 60 sec x 1000 ms) and then subtract that from your&amp;nbsp;&lt;EM&gt;Date&lt;/EM&gt; using a Field Calculator. The eventual expression would be something like:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;myDate - (16 * 3600 * 1000)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;This assumes you are able to extract the value "16" from a string&amp;nbsp;"Thu Dec 30 16:00:00 PST 2021" to know that you wanted to subtract 16&amp;nbsp;&lt;U&gt;&lt;EM&gt;hours&lt;/EM&gt;&lt;/U&gt; worth of&amp;nbsp;&lt;EM&gt;&lt;U&gt;milliseconds&lt;/U&gt;&lt;/EM&gt; from the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;myDate&lt;/FONT&gt; attribute value.&lt;/P&gt;&lt;P&gt;You also might want to look at some of the supported expressions for the &lt;A href="https://enterprise.arcgis.com/en/geoevent/latest/analyze/field-calculator-processor.htm" target="_self"&gt;Field Calculator processor&lt;/A&gt;. The function&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;currentOffsetUTC()&lt;/SPAN&gt;&lt;/FONT&gt; specifically computes the millisecond&amp;nbsp;difference between your GeoEvent Server's locale and UTC. Since my server is configured to use the Pacific Time Zone, which is currently -08:00 hours behind UTC, the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;currentOffsetUTC()&lt;/SPAN&gt;&lt;/FONT&gt; function returns a value &lt;STRONG&gt;&lt;FONT color="#993300"&gt;-28800000&lt;/FONT&gt;&lt;/STRONG&gt;, which is (8 hours x 60 minutes x 60 seconds x 1000 milliseconds). You might scale the computed value by some constant when performing date/time adjustment arithmetic, or more likely, shift an epoch&amp;nbsp;&lt;EM&gt;Date&lt;/EM&gt; from an assumed local time zone so that the value represents a UTC value.&lt;/P&gt;&lt;P&gt;The advantage of using&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;currentOffsetUTC()&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;is that the function automatically recognizes changes in daylight savings, so you don't have to rely memory to update GeoEvent Services twice a year when a fixed constant value you might have hard-coded in an expression no longer reflects the observance of daylight savings time.&lt;/P&gt;&lt;P&gt;See Also:&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-geoevent-server-blog/what-time-is-it-well-that-depends/ba-p/889410" target="_self"&gt;&lt;SPAN&gt;What time is it? Well That Depends...&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 00:50:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-geoevent-server-questions/converting-between-date-formats/m-p/1031228#M3484</guid>
      <dc:creator>RJSunderman</dc:creator>
      <dc:date>2021-02-27T00:50:02Z</dc:date>
    </item>
  </channel>
</rss>

