How to format dates in Make
To convert a date into another format in Make, send it to the 1001fx function formatdatetime with the target format, for example DD.MM.YYYY HH:mm. With formatsToTest you list the formats the input may have, which helps with ambiguous dates such as 14/08/22.
Step by step
- 1
Get your API key
Create a free 1001fx account and copy your API key from the app.
- 2
Start the scenario
Start with the module that delivers the date, for example Google Sheets "Watch new rows" or a webhook.
- 3
Add the HTTP – Make a request module
Add the HTTP – Make a request module and send a POST request to https://api.1001fx.com/datetime/formatdatetime with the header X-API-KEY and your API key.
- 4
Fill the fields
- date
- – The date from the previous module, for example 14/08/22.
- format
- – The output format, for example DD.MM.YYYY HH:mm or YYYY-MM-DD.
- formatsToTest
- – Optional list of input formats to try, for example DD/MM/YY and MM/DD/YY.
- 5
Use the result
The answer is JSON with result, for example 14.08.2022 00:00. Map result into the next module.
How to set up the HTTP – Make a request module: 1001fx for Make.
formatdatetime costs 1 credit per call. All parameters and examples: formatdatetime reference.
Tips
- Use converttimezone to move a date into another time zone.
- Use addtodate to add or subtract days, months or years before formatting.
Frequently asked questions
- Which format tokens can I use?
- Tokens such as DD for the day, MM for the month, YYYY for the year, HH for the hour and mm for the minute, for example DD.MM.YYYY HH:mm.
- My dates come in different formats. What can I do?
- List the possible input formats in formatsToTest. Without it the date has to be in one of the formats named on the function page, such as DD.MM.YYYY.