1

In arcmap, I export a layer as shapefile. After that I find from the dbf file, the editor tracking date-time columns (created_date, last_edited_date) value only contain the date value, The time value is not available.

Is it normal? How can I get the time value in the dbf file also?

I am using arcmap 10.2.2.

2
  • 4
    DBF format supports only DATE, not time. From webhelp.esri.com/arcgisdesktop/9.3/… "and they cannot store both a date and time in a field"
    – user30184
    Commented Sep 29, 2014 at 8:45
  • Does your export layer need to be a shapefile?
    – artwork21
    Commented Sep 29, 2014 at 14:28

1 Answer 1

2

It as as user30184 said. DBF tables/shapefiles do not support time values in the same field as date values. You can, however, split the datetime value over a date field and a text field containing the time. However you won't be able to run proper queries on this time field as its values are not recognised as proper time values. Shapefiles don't support datetimes, just dates. They probably will never. Instead, you can export your data to a personal geodatabase feature class, which will make it possible to edit the table's values in a database management program like MS Access.

EDIT: I added a comment, tried to edit it but I couldn't edit it for more than 5 minutes so now it's lost.

This is what I wanted to say: You could make two seperate fields in the shapefile for date and time and use VB script (or python) to extract just the date (vb script function DateValue() )or just the time (vb script function TimeValue()) from the datetimefield. Another idea that just came up is storing the datetime as a long integer, in seconds since 1-1-1900 (Excel does kind of the same thing if I recall correctly). This does retain the proper value of the datetime, although it's not convenient to work with.

1
  • Hi Menno, thanks for the advice. All the exporting and retrieving need to developed in vb.net, I cannot use MS Access to open the personal geoDB. And I also no idea how to store data and time separately in the dbf file.
    – ppLily
    Commented Sep 30, 2014 at 3:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.