I have an array with values and I have mapped all the dates (they are in timestamp format) and now I have all the dates in an array. So how do I change the format (DD/MM/YYYY) of all the dates in that array?
Welcome to the Make community!
You should use the formatDate
function before you aggregate the values into an array.
According to the Tokens you can use to format a date variable, you can use DD/MM/YYYY
.
e.g.:
{{ formatDate(now; "DD/MM/YYYY") }}
For more information, see Date Format links below.
Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —
Getting Started
- Help Centre | Tutorials – Make “Manual”
- Make Academy – Basics 101: Learn Make and get certified
Help Centre Basics
- Mapping – What is mapping? What can I map?
- Mapping with arrays – How to map items in an array
- Aggregate an array for mapping complex fields
- Date Format: tokens for
parseDate
| tokens forformatDate
- HTTP modules – Make a request, Get (download) a file
- Webhooks – Error Handling, Responding to webhooks
Articles & Videos
- Router Magic Formula - YouTube
- Error Handlers in Make - YouTube playlist
- Getting started with OpenAI - How to setup and use OpenAI (ChatGPT) in Make
- How to use Regex in Make - How to use pattern matching to extract the text you want
- Webhooks – Make Academy – tutorial on how to use Webhooks
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.
The problem is that I receive those dates in an array already and I need to modify the format of those dates
When you see ARRAY, think ITERATOR.
Then,
Aggregators
Every result (item/record) from iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.
Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.
There are other types of aggregator modules, click the below links to find out more:
- Array aggregator
- Text aggregator
- Numeric aggregator
- Table aggregator
- JSON aggregator
- CSV aggregator
- Archive (ZIP) aggregator
- other app-specific aggregators
So, to answer your question, you probably need an Iterator, then Set Variable, before an Array Aggregator.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.
Thanks @samliew for your support I really appreciate. But now I have a weird problem: I put the current time in timestamp format and when I use formatDate( to get the current date with this DD/MM/YYYY format, I get a date from 1970. Why am I not getting the current date?
![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/8/581e2e12888a77a0894c1007c96872191ffa9751.png)
@Clof_Company, You might have to parseDate() first and then formatDate(). use parseDate(date;x) to parse unix timestamp. See :
You can use formatDate() function inside a text aggregator. First you will need to iterate the array.
Regards
Msquare Automation - Platinum partner of Make
@Msquare_Automation