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.
1 Answer 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.
-
and how to convert the 4 fields into date format field???user3503064– user35030642015年04月23日 18:51:03 +00:00Commented Apr 23, 2015 at 18:51
-
Use the convert date format toolJKyllo– JKyllo2015年04月23日 19:27:20 +00:00Commented 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 workuser3503064– user35030642015年04月23日 19:31:04 +00:00Commented 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(...)"gotchula– gotchula2015年04月24日 15:10:12 +00:00Commented Apr 24, 2015 at 15:10