Adding Date to Field in Model Builder

234
3
05-10-2022 03:49 PM
SaraJCourter
New Contributor II

I'm trying to add an inline variable to my feature class to add the date. I know that adding %t% will add in the date and time, but I only want to add the date. Specifically, I would like this model to pump out the feature class with the current date (the date the tool is run on) in the format YYYYMMDD. Is there a quick solution besides me just having it as a parameter? 

0 Kudos
3 Replies
KimGarbade
Occasional Contributor III

I hope this helps.

KimGarbade_0-1652267228313.png

time.strftime("%y%m%d")
0 Kudos
SaraJCourter
New Contributor II

For some reason, I can't find the Calculate Value tool. Also, I need the year in YYYY (2022)

0 Kudos
KimGarbade
Occasional Contributor III

You can find it under the Utilities menu in the ModelBuilder tab.  Try using a capital Y instead of the lower case one I sent earlier.

KimGarbade_0-1652280166204.png

time.strftime("%Y%m%d")
0 Kudos