madgame

Formating field values

Discussion created by madgame on May 13, 2013
Latest reply on May 15, 2013 by ldonahue
I'm trying to create a feature class with a number of fields, and I've got the data to load properly.  However; I'd like to format the Date field so that the ArcMAP (Identify) always displays the date and time when selected in ArcMAP.  Is there a way to specify the formatting for a specific field value?

Here's what I've got thus far... (I'd like for it to always display as YYYYMMDD HH:mm:SS UTC instead of the default of 12:00:00 AM)

        
public static IFeatureClass createFeatureClassWithSR(string fcn, IFeatureWorkspace fw, ISpatialReference sr, string filname) {
            IFeatureClassDescription fcDesc = new FeatureClassDescriptionClass();
            IObjectClassDescription objDesc = (IObjectClassDescription)fcDesc;
            IFields fields = objDesc.RequiredFields;
            IFieldsEdit fieldsEdit = (IFieldsEdit)fields;
            int shapeIdx = fields.FindField(fcDesc.ShapeFieldName);
            IField field = fields.get_Field(shapeIdx);

            IField f18 = new FieldClass();
            IFieldEdit f18Edit = (IFieldEdit)f18;
            f18Edit.Name_2 = "TOA";
            f18Edit.Type_2 = esriFieldType.esriFieldTypeDate;
            f18Edit.AliasName_2 = "TOA";
            f18Edit.IsNullable_2 = false;
            f18Edit.Editable_2 = false;
            DateTime d = new DateTime();
            f18Edit.DefaultValue_2 = d;
            fieldsEdit.AddField(f18);


Thanks

Outcomes