rblash

Need help getting year from a date field (field calculator)

Discussion created by rblash on Jun 3, 2016
Latest reply on Jun 3, 2016 by bixb0012

I have dates (in a date field) of mixed formatting (1/21/2006 4:19:20 AM, 12/27/2007, etc.). I need to populate an integer field with just the year.

 

Based on this thread I'm trying to work my way through it but I can't get it figured out

 

d = datetime.datetime.strptime(!InstallDate!, "%d/%m/%Y")
justyr = datetime.datetime(d.year)

 

Any help would be appreciated!

Attachments

Outcomes