Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Date Time Format

OEvangelista
7 - Meteor

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? 

4 REPLIES 4
PhilipMannering
16 - Nebula
16 - Nebula

Hey @OEvangelista 

 

One solution might be to pad your data with zeros beforehand. Something like,

datetimeparse(padleft(tostring([Field1]), 8, '0'), '%m%d%Y')
MarqueeCrew
20 - Arcturus
20 - Arcturus

@OEvangelista ,

 

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

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
OEvangelista
7 - Meteor

Thanks!

OEvangelista
7 - Meteor

Thanks

Labels