There are 2 datetime formatting functions supported in formula mode that look similar. When should you be using which function?
to_date
Input: Date/time or String
Output: Date/time
Use to_date when you need to specify the input data's format. For example, if I'm passing in an ambiguous date (05/10/2016) in the MM/DD/YYYY format, and not the DD/MM/YYYY format, I can use the to_date(format: "MM/DD/YYYY") function to make it very clear to the recipe what date format it is in.
strftime
Input: Date/time
Output: String
This function takes in only datetime data types and outputs them as a string in a certain format specified in the function. For example, I need to add a date to my Google Sheets in the "MM/DD/YYYY" format. If a data pill with the date/time type is mapped directly to Google Sheets, it appears as "2016-08-05 10:20:50 -0700". Instead of mapping the data pill directly to my Google Sheets action, I can use the strftime("%m/%d/%Y") function to format the output and send it to Google Sheets as "08/05/2016".
For more information on the placeholder values that can be used with the strftime function, refer to our common formula (operators) list.