AnsweredAssumed Answered

Formatting date as string from user input date value in ModelBuilder

Question asked by nbanerjee on Jun 15, 2019
Latest reply on Jun 16, 2019 by curtvprice

I cant seem to get best way of handling date fields in ModelBuilder/ArcGIS environment.  I created a very simple model in ModelBuilder that accepts a date object (that I used with 'Create Variable) (see first graphic).  All I am trying to do is calculate that date object as a string formated in (YYYYmmdd) using the 'Calculate Variable' tool.  I expected that since it is a date object that I could simply just use the ".strftime" method to format the date (see 2nd graphic).  However I get an error message (3rd graphic) that seems to be implying that the object is an integer. 

Can someone point me to how this should be done?  I also tried constructing the date using using datetime.datetime.strptime() and then using strftime(), but that didnt work either