Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Datetime functions

Natasha4
5 - Atom

Hello Everyone,

 

I am struggling a lot to understand date time functions. what is the difference between datetimeparse and datetimeformat functions? Which function to use when, their significance etc. Could someone please guide here?

3 REPLIES 3
JosephSerpis
17 - Castor
17 - Castor

Hi @Natasha4 happy to help so DatetimeParse is a formula to make your date in your data a format that alteryx can recognize which is YYYY-MM-DD. If in your data your dates were in the format dd/mm/yyyy and you want to perform datetime fuctions in alteryx you would need to use a formula like this DatetimeParse([Column],"%d/%m/%y")  where you specify how the date if formatted in your data. 

 

Datetimeformat is where you can tell alteryx how you want the date formatted because you require it to be a certain way for a database or an output. Therefore it's possible to format the date in a variety of possible ways however the formatted date will though not be a recognize date format data type in alteryx.

 

I typically convert my dates in my data fairly early on in my workflow perform any datetime functions like datetimeadd or datetimediff then near the end of my workflow, use Datetimeformat as I need the date in certain format.

 

I've included the link for Datetime Function help if you search for DatetimeParse and DatetimeFormat they explain this in more detail.

zajaccount
9 - Comet

I believe that the explanation provided by Joseph is clear enough.

 

I would also recommend these two resources:

 

https://help.alteryx.com/11.0/Reference/DateTimeFunctions.htm#DateTimeParse

 

Natasha4
5 - Atom

Indeed helpful. Thanks much Joe 🙂

Labels