Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

String to Date Conversion

jderienzo
6 - Meteoroid

I am trying to convert a string field that is actually a date to a specific format:

 

example: string reads 050619 and I need to convert it to 05/06/2019.

 

Thanks in advance for the help.

 

 

 

 

4 REPLIES 4
AlteryxUserFL
11 - Bolide

Hello, 

 

You need the DateTime tool. https://help.alteryx.com/2018.3/DateTime.htm?Highlight=date%20time

 

String to Date/Time format: Converts string data to a DateTime format in the yyyy-MM-dd format or yyyy-MM-dd hh:mm:ss format.

  • Select the string field to convert: Select from the list. The field is greyed out and reads "No Suitable Input Fields Available." if no DateTime columns are present.
  • Specify the new column name: Enter a new column name or use the default DateTime_Out.
  • Select the format that matches the incoming string field: Select a format from the list, or select Custom to identify a different format in Specify the format of the incoming string field.

EDIT: 

Please see the attached example :) 

KP_DML
8 - Asteroid

You can use the DateTime tool to parse the string to date from a custom format. In your example it is MMddyy.

CharlieS
17 - Castor
17 - Castor

Hi @jderienzo 

 

Here's the expression to parse that string into the standard Alteryx format, then output in the format you specified:

 

DateTimeFormat(DateTimeParse([String],"%m%d%y"),"%m/%d/%Y")

 

In this case, i place your input value, "050619" into a field called [String].

jderienzo
6 - Meteoroid

Drew:

 

Thank you for the detailed answer and sample, work perfectly.

 

Kind Regards,

 

Jason D.

Labels