I have a date (i.e. 7292020) which I am trying to convert to a date format using the DateTime tool. I specified the format of the incoming string field as %m%d%Y but I get the error "Cannot convert "7292021" to a date/time with format "%m%d%Y."...Month number is out of range". Please advise what am I doing wrong?
Hey @OEvangelista
One solution might be to pad your data with zeros beforehand. Something like,
datetimeparse(padleft(tostring([Field1]), 8, '0'), '%m%d%Y')
I don't think that you did anything wrong. It looks like a bug to me. You can use:
DateTimeParse(padleft([Field1],8,"0"),"%m%d%Y")
I'll copy @joshuaburkhow for his 2 cents
Cheers,
Mark
Thanks!
Thanks