Hello,
I am new to Alteryx, I have a question regarding the date and time format.
Input
DateTime
01-01-21 14.45.06
02-01-21 14.55.06
Output Expected
Date Time
01-01-21 14.44.06
02-01-21. 14.55.06
In python
pd.to_datetime(df_final['date'])
df_final['date'].dt.time
df_final['date'].dt.date
How can we do it Alteryx ?
Alteryx only recognizes YYYY-MM-DD hh:mm:ss for "datetime" formats so first you'll have to do that. You can use the "DateTime" tool on the RegEx palate for that.
Once it's in that format (2021-01-01 14:45:06) just add a new field via formula tool with type "date" and another with type "time" and it will strip off the applicable portions for you.
Hello @RVK_RM ,
You can use the following formula to add the time formula:
DateTimeParse([Field1],'%d-%m-%Y %H.%M.%S')
Regarding the format, alteryx always uses the same format to display Date and Time which is the ISO:
YYYY-MM-DD HH:MM:SS
The only soltuion would be to change it to the expected format one you finish everything but you have to know that the cells would be strings (no longer dates).
Regards
Nice one @afv2688 !! I forgot about DateTimeParse - can do it with just one tool that way!
I am getting the null value when I try to extract the date from the date time column.
Hello @RVK_RM,
Could you share an yxdb with some of the examples with me. I would be able to share then with you a solution.
Regards
that did not work for me but thanks
DateTimeParse ([Field1],'%d-%m-%Y %H.%M.%S')
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |