How can I use yyMMdd_HHmmss instead of {{timestamp}} in filenames?

Hi,

I have a sequence where I generate an image with DALL-E, download it via HTTP-request, save it to OneDrive (original file name always output.png) and rename it (see screenshot).

For the renaming I am currently using {{timestamp}} in the filename to have a unique identifier. However, I can’t really work with the unix timestamp here and would be more interested in creating a filename like: filename_yyMMdd_HHmmss (e.g. 220423_114235). How can I create such a timestamp?

Thanks

Welcome to the Make community!

According to the Tokens you can use to format a date variable, you can use yyMMdd_HHmmss.

e.g.:

filename_{{ formatDate(now; "yyMMdd_HHmmss") }}

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 Basics

Articles & Videos

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

Thank you @samliew! I integrated your variable here:

filename_{{1.id}}_{{1.row.b.text}}_Concept_{{ formatDate(now; "yyMMdd_HHmmss") }}.png

However, the result will be:

xxxxx_Concept_202408Mo_215744.png

Where does the “Mo” come from and how can I get rid of that? :wink:

Thanks for your help - I am not a coder and I don’t fully understand all parameters and variables.

There is no lowercase yy for year. Did you mean to use YYYY?

Lowercase dd is a two-letter abbreviation for the Day of Week. Did you mean to use DD instead?

For more information, see tokens for formatDate link above.

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

Thank you for pointing me in the right direction. This was my solution:

_{{ formatDate(now; "YYMMDD_HHMMss") }}.png

For all other non-coders: Lower/upper case makes a big difference here, so carefully read: https://www.make.com/en/help/functions/tokens-for-date-time-formatting

2 Likes