Select to view content in your preferred language

Calculating burn roughs in ArcPro

273
1
05-01-2024 12:28 PM
Ronowens1
New Contributor

Trying to calculate burn roughs in ArcPro. No problem calculating in ArcGIS 10.8.

Burn rough2 = (Date1 - Last_burned)/365

Current_date and last_burned_date are date fields (month/day/year)

When I attempt to run I get following error:

Ronowens1_0-1714591571876.jpeg

Anyone know what changed from ArcGIS to ArcPro, and how to correct?

I thank you,

RRO

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

dates changed between python 2.7 and 3.x, you will have to check the appropriate python documentation and examples on the web.  Here is an example of what is returned in python 3.11

 

d1 = datetime(2024, 1, 1)

import datetime

d1 = datetime.datetime(2024, 1, 1)
d2 = datetime.datetime(2024, 1, 31)

d2 - d1
datetime.timedelta(days=30)

(d2 - d1)/365
datetime.timedelta(seconds=7101, microseconds=369863)

so you will have to convert to your appropriate date format and or desired scalar value


... sort of retired...
0 Kudos