âShow Table of Contents
The DateTime tool transforms date/time data to and from a variety of formats, including both expression-friendly and human readable formats.
Alteryx cannot process dates prior to January 1, 1400.
Select the format to convert:
- Date/Time format to string: Converts date/time data in the yyyy-MM-dd format or yyyy-MM-dd hh:mm:ss format to a string.
- String to Date/Time format: Converts string data to a date/time format in the yyyy-MM-dd format or yyyy-MM-dd hh:mm:ss format.
- Select the field to convert. If the data does not include date/time or string data, the text box will display âNo Suitable Input Fields Available."
- Specify a new column name, or use the default DateTime_Out.
- Select the format for the new column (with the Date/Time format to string option) or the format that matches the incoming string field (with the String to Date/Time format option).
Select Custom to specify your own format. Alteryx will then show an example based on the format you specify.
You can use the specifiers and separators as described in Formats (for example, dd, MM, yyyy), or the specifiers and separators supported by the DateTimeParse and DateTimeFormat functions (for example, %d, %m, %Y).
Day, Month, and Year Format Specifiers
- dd Day of the month as digits with leading zeros for single digit days. (On input, leading zeros are optional.)
- dy. English day of the week as a 3-letter abbreviation. (On input full names are accepted, but Alteryx does not check that the day of the week agrees with the rest of the date.)
- MM Month as digits with leading zeros for single digit months. (On input, leading zeros are optional.)
- Mon. A three letter abbreviation of the English name of the month. (On input, full names are also accepted.)
- Month English name of the Month. (On input, abbreviations are also accepted.)
- yy Year represented only by the last two digits. When converting from a string, two digit years will be mapped into the range from current year minus 66 years to the current year plus 33 years. So, in 2016, a two-digit year will be mapped into the range 1950 to 2049. (On input, four digits will also be accepted.)
- yyyy Year represented by the full four digits. (On input, two digits will also be accepted and mapped as done for the âyyâ pattern.)
Hour, Minute, and Second Format Specifiers
- HH or hh Hours with leading zeros for single-digit hours (24-hour clock).
- mm Minutes with leading zeros for single-digit minutes.
- ss Seconds with leading zeros for single-digit seconds.
On output, separators in the date/time format are used exactly. On input:
- â-â and â/â are accepted as equivalent
- white space is ignored
- â:â and â,â must match exactly.
Â©2017 Alteryx, Inc., all rights reserved. AllocateÂ®, AlteryxÂ®, GuzzlerÂ®, and SolocastÂ® are registered trade