<?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: Set Date for Feature in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/set-date-for-feature/m-p/476975#M3275</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikrant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It depends of the FieldType of your feature's date attribute. If it's of type DATE, you should set a value of type Calendar. If it's of type TEXT, then you should set a value of type String, as you have tried above. See also:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/data/Field.Type.html"&gt;https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/data/Field.Type.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gunther&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Jun 2019 20:31:27 GMT</pubDate>
    <dc:creator>GuntherHeppner</dc:creator>
    <dc:date>2019-06-24T20:31:27Z</dc:date>
    <item>
      <title>Set Date for Feature</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/set-date-for-feature/m-p/476974#M3274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do we set the date value for feature attribute, when creating new feature. Here is what I am trying by setting as String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;String dateTime &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; imgData&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getAttribute&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ExifInterface&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TAG_DATETIME&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
Date photoDate&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dateTime &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; null&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 String photoDatePat &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"yyyy:MM:dd HH:mm:ss"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 SimpleDateFormat simpleDateFormat &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;SimpleDateFormat&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;photoDatePat&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Locale&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;US&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 photoDate &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; simpleDateFormat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;parse&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dateTime&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 photoDate &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Date&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
attributes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;put&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Fields&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PHOTO_DATE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; photoDate&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toString&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;, and when setting as a date type&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;attributes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;put&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PHOTO_DATE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; photoDate&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this errors out as&amp;nbsp;&lt;SPAN style="color: #000000; font-weight: normal; text-decoration: none; font-size: 16px;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff; font-weight: normal; text-decoration: none; font-size: 16px;"&gt;Conversion to CoreElement not implemented: class java.util.Date'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:04:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/set-date-for-feature/m-p/476974#M3274</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T21:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set Date for Feature</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/set-date-for-feature/m-p/476975#M3275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikrant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It depends of the FieldType of your feature's date attribute. If it's of type DATE, you should set a value of type Calendar. If it's of type TEXT, then you should set a value of type String, as you have tried above. See also:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/data/Field.Type.html"&gt;https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/data/Field.Type.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gunther&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2019 20:31:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/set-date-for-feature/m-p/476975#M3275</guid>
      <dc:creator>GuntherHeppner</dc:creator>
      <dc:date>2019-06-24T20:31:27Z</dc:date>
    </item>
  </channel>
</rss>

