The DateTime function allows you to convert between date and string formats.
This is what the tool looks like in Alteryx:
![](https://www.thedataschool.co.uk/content/images/2022/12/image-128.png)
The default date format in Alteryx is 'yyyy-MM-dd'. Time is "hh:mm:ss" and datetime is "yyyy-MM-dd hh:mm:ss."
You can choose a field to convert and create a new column with your converted data.
Below is how you convert a date to string:
![](https://www.thedataschool.co.uk/content/images/2022/12/image-129.png)
You need to specify the format for the string to be outputted in. You can output the string in a number of different pre-determined format types. You can also create a custom format to output your string.
Below is what you use to convert a string to a date:
![](https://www.thedataschool.co.uk/content/images/2022/12/image-130.png)
If the format of your string doesn't match the predetermined options then you can select an input format to use in your conversion.
The DateTime tool is really useful because it allows you to create dates that can be manipulated and used in the formula function. You can use date to string conversions to output strings that can be used in string messages.