Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here
SOLVED

Convert 2018-04-12T13:27:48.517Z to EST

Highlighted
8 - Asteroid

I am pulling dates in through an API and it is coming through formatted as above.  After looking online I believe the "Z" is stating the date is in UTC and the T is simply a barrier between the date and time.  Now what would be the best way to convert this to a date time string in EST?

 

I tried the simple "DateTime" icon converter but I believe the T and Z are confusing it.  

 

I tried creating my own Regex to convert this to a string and then thought I'd use the DateTimeToLocal() command to get to the datetime I want.  Below is my Regex.  Would it be easier to just remove the T and Z, convert to datetime and then datetime local?

(\d{2}-\d{2}-\d{4}T\d{2}:\d{2}:\d{2}.\d{3})

 

Highlighted
Alteryx
Alteryx

Using the DateTime tool in Custom mode with the following in the formula should do the trick;

 

yyyy-mm-ddThh:mm:ss

 

You'll still need to convert to local, but to get it in DateTime type, this should work.

 

image.png

 

Cheers!

Zak

Highlighted
8 - Asteroid

Thank you, that was so much simpler than what I was trying to do!

Highlighted
Alteryx Certified Partner

You can also use this formula to remove T & Z:

Replace(Replace(YOUR_DATE_TIME, 'T', ' '), 'Z', '')

Select the data type of the output as datetime & convert to your preferred timezone

 

Karam

Highlighted
17 - Castor
17 - Castor

hi @ISUGraber

 

Once you have the UTC datetime in Alteryx format, you can use the DateTimeToLocal() function, in a formula tool of course, to convert it to your local time zone.

 

Dan

Labels