0

i have ab Excel table which it's fields are (year,month,day,hour,AM/Pm), how to convert those Fields into a Date format table in Arcgis and then creating a time frame Visualization.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Apr 23, 2015 at 17:05

1 Answer 1

1

If the cells are date format you can just use the ExcelToTable tool. Which is new at 10.2. The tool converts xls, xlsx to a gdb table and handles dates correctly.

On 10.1, you can download and use an earlier version of the functionality here.

If the cells are a string, you can use python's strptime to convert the string to a datetime object . What i'd do is import your excel to gdb, add a new 'actual_date' field, and use the CalculateField tool to convert the text field to a datefield.

answered Apr 23, 2015 at 18:41
4
  • and how to convert the 4 fields into date format field??? Commented Apr 23, 2015 at 18:51
  • Use the convert date format tool Commented Apr 23, 2015 at 19:27
  • The Year , Month , Day Fields are each separated and the Month Field format is Like this "FEB,APR....." so it didn't work Commented Apr 23, 2015 at 19:31
  • oh, use calc field and set the expression as toDate(!Year!, !Month!, !Day!), and set the codeblock to "def toDate(y,m,d): datetime.strptime(...)" Commented Apr 24, 2015 at 15:10

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.