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?
Solved! Go to Solution.
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.
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
Whenever learning something new in Alteryx, I suggest using the interactive lessons, there is one on DateTime functions as well:
https://community.alteryx.com/t5/Interactive-Lessons/DateTime-Functions/ta-p/98952
Indeed helpful. Thanks much Joe 🙂