Date time format in Alteryx designer ?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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 ?
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Nice one @afv2688 !! I forgot about DateTimeParse - can do it with just one tool that way!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
My date format is already in this "2021-01-01 14:45:06" format., Type is Date Time.
In the formula tool - The date preview is "Null".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am getting the null value when I try to extract the date from the date time column.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
that did not work for me but thanks
DateTimeParse ([Field1],'%d-%m-%Y %H.%M.%S')
