cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Date Format in Recipe for Google Drive Folders

energidi
Deputy Chef II
Deputy Chef II

Hi everyone,

I have a Workato recipe that connects Salesforce with Google Drive.
In the recipe, I’m creating Google Drive folders where the folder names are based on Contact names and their Date of Birth.

This setup works perfectly.

However, I want to change the Date of Birth format, which comes from the 'Date_of_Birth__c' Contact date field, from YYYY-MM-DD to MM-DD-YYYY.

How can this be achieved?

5 REPLIES 5

theiiienrique
Deputy Chef I
Deputy Chef I

Hi @energidi, you can use the strftime formula to achieve this.

Example:

2025-01-06_13-25-18.png

 

Obugari
Deputy Chef III
Deputy Chef III

Hi @energidi ,
you can change the format using date formula .strftime("MM-DD-YYYY") and .to_date(format: "MM-DD-YYYY")date.png

 

shivakumara
Executive Chef III
Executive Chef III

Hi @Obugari ,
Correction:
Using to_date will not produce the desired output in this case, as it is specifically designed to convert input data into a date format and returns it as YYYY-MM-DD. If you run the formula as suggested earlier, it will result in an error.

Preferred Solution:
Instead, using strftime is recommended. It allows you to format the date into any desired output format, giving more flexibility to meet end-user requirements.

Conclusion:

  • to_date: Converts a string to a date using a specified input format and returns it in YYYY-MM-DD.
  • strftime: Formats a date into a custom output format as required by the user.

Thanks and Regards,
Shivakumar K A

Hi @shivakumara ,

Thanks for clarification , but in workato docs they have mentioned we can use the format also. I will try that and let you know on this date1.png