Free Trial

Alteryx Designer Desktop Discussions

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

Changing Date Format

Cfdiaz2103
8 - Asteroid

Hi Everyone.

 

I'd appreciate your help if you could guide me how I can convert a string to a date data, if the original format is the following:

 

String Format Example:

Jun 2 2021 02:16PM

May 24 2021 9:12AM

 

Final Result

2021-06-02 14:16

2021-05-24 9:12

 

As you can see, I have some trailing spaces, including 2 trailing spaces if the Day or the Time Hour has one digit.

 

I´ll be grateful for you response.

4 REPLIES 4
Luke_C
17 - Castor
17 - Castor

Hi @Cfdiaz2103 

 

Here's an example. I didn't see extra spaces in your data, but I added one and the datetimeparse formula seems to still work fine, so you shouldn't have an issue.

 

datetimeparse([String Format Example:],'%b %d %Y %I:%M%P')

 

Luke_C_0-1627070664971.png

 

JagdeeshN
12 - Quasar
12 - Quasar

Hi @Cfdiaz2103 ,

 

Please find attached a sample workflow to accomplish what you have described.

 

Do let me know if this helps.

 

best,

Jagdeesh

Cfdiaz2103
8 - Asteroid

Hi @Luke_C !

 

It works perfectly. Seems like after copying the data just like before, it didn't bring the double trailing space as I had mentioned, but it's just fine.

 

Thank you for your support 😁

 

 

Cfdiaz2103
8 - Asteroid

Hi @JagdeeshN !

 

That worflow suits perfectly, however it contains too many tools to reach the final result😁

 

Thanks in advance for your support 

Labels
Top Solution Authors