Hi All,
My input data containing a column of datetime, example: "07/31/2025 1:41PM" which needs to be changed as "07/31/2025".
i tried with datetime tool (customize) %m/%d/%y %I:%m%p. so in a new column its gives output for few of the cells, but rest of them were blanks. Please advise, if customize was incorrect or is there is an alternative method to achieve the same output (example: 07/31/2025) ?
Thank you
Solved! Go to Solution.
@AgiGovind If you only need the date just use the "text to column" tool. Use \s as delimeter.
You can use DateTime Parse tool to convert the incoming datetime field to Alteryx standard DateTime field. Once you get that, add a select tool and change the data type to Date from DataTime. This will give you your desired value. Snip below.
Parse Configuration:
MM-dd-yyyy HH:mm
Select tool config:
Hi @AgiGovind
You were close, you need to uppercase the code for Year, and for Minute - use a Formula tool and apply this code to first change it to the ISO Standard Format using DateTimeParse, then wrap it in a DateTimeFormat to change it to just the specific date format you require:
DateTimeFormat(DateTimeParse([Date],'%m/%d/%Y %I:%M%p'),'%m/%d/%Y')
Similar to @davidskaife used a formula tool, but trimmed the string then used datetime parse
DateTimeParse(left([Field1],10),"%m/%d/%Y")