Hello,
I have a string field (named StartDate) in an attribute table that contains numerous 5 digit (post 1900, Excel style) values (such as 40,240) that I need to convert into into a readable date format (which in this case would be MM/DD/YYYY).
I have created an empty field named StartDateDT to house the converted serial dates. The field is in DATE format.
What is the code in VB (preferred) or python to do this?
I am using ArcMap 10.22, standard (aka ArcEditor) license, BTW.
Many THANKS in advance!
Phil in Houston
Solved! Go to Solution.
No, Managing Data is fine since it is really just about a data format conversion and not specific to Python or Geoprocessing.
Dealt with this issue today. Your code worked after we told it to view the string field as an integer.
This is the code we used in the Field Calculator:
datetime.datetime(1899,12,30) + datetime.timedelta(days = int( !START_DATE!))
Related Links:
https://community.esri.com/ideas/16476-excel-to-table-date-conversion
https://community.esri.com/thread/231594-date-field-in-excel-to-table-tool