SNLFinancial

Calculating Date for ArcSDE gdb - not getting Hours, Minutes, Seconds

Discussion created by SNLFinancial on May 7, 2012
Latest reply on May 8, 2012 by dwynne-esristaff
Hello,

I'm trying to calculate a date field for a feature class in an ArcSDE gdb using Python. My script successfully calculates the year, month, day but only calcs zeros for hours minutes seconds. Can you help? Here is the relevant portion of my script:

# Import system modules
import arcpy, os, sys
from arcpy import env
import datetime

nowDate = datetime.datetime.now()
dateExp = nowDate.strftime("%Y-%m-%d %H:%M:%S")
arcpy.CalculateField_management("selectLyr", "UpdDate", "date '" + dateExp + "'", "", "")

Outcomes