vkrishna327

Set Date for Feature

Discussion created by vkrishna327 on Jun 19, 2019
Latest reply on Jun 24, 2019 by gheppner-esristaff

How do we set the date value for feature attribute, when creating new feature. Here is what I am trying by setting as String

 

String dateTime = imgData.getAttribute(ExifInterface.TAG_DATETIME);
Date photoDate;
if(dateTime != null) {
String photoDatePat = "yyyy:MM:dd HH:mm:ss";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(photoDatePat, Locale.US);
photoDate = simpleDateFormat.parse(dateTime);
}else {
photoDate = new Date();
}
attributes.put(Fields.PHOTO_DATE, photoDate.toString());

 

, and when setting as a date type 

 

attributes.put(Field.PHOTO_DATE, photoDate)

 

 

this errors out as 'Conversion to CoreElement not implemented: class java.util.Date'

Outcomes