jduval

How to calculate date field in python script - formatting question

Discussion created by jduval on Feb 11, 2011
Latest reply on Jun 25, 2013 by Kristya
I am trying to calculate a DATE field on a feature class in a personal geodatabase.  I have a date variable that is a string: distDate = "2011-02-11"

I am not able to figure out the proper formatting to get it to work in a python script.  This is what I have, but it does not update with this date, nor does it error out.  In ArcMap, I can use calculate field on the attribute table and successfully update the date with #2011-02-11# (VB).

arcpy.CalculateField_management (inFC, "DistDate", "#"+distDate+"#")

I could not find help on the ESRI support site, nor by just googling it.  Does anybody have suggestions?

Julie

Outcomes