What are you trying to achieve?
Hello everyone,
I’m having a hard time figuring out what’s the problem here. I have a unix time stamp that I want to convert in a date format (YYYY-MM-DD) but I’m receiving a wrong result.
You can see the functions I’m using, the unix time stamp to convert and the result I’m getting, directly from the screenshots. Any idea?
Thank you in advance!
Screenshots: scenario setup, module configuration, errors
Welcome to the Make community!
According to the Tokens you can use to parse a date variable, you can use a lowercase x
.
e.g.: parseDate({{now}}; x)
For more information, see Date Formats in the Help Center.
samliew – request private consultation
Join the Make Fans Discord server to chat with other makers!
Hi samliew and thank you.
I already tried that solution but with a lowercase x
I encounter this error:
Hi @Marco_Mindstone
Input 1)
Output:
Input 2:
Output:
Regards,
Msquare Automation - Gold Partner of Make
Free Consultation | Live Implementation
Visit us here | Youtube Channel
Hi @Msquare_Automation and thank you.
Finally I’ve come to a conclusion with one step.
The problem was that ClickUp sent me the UNIX date with 13 characters, and I tried to use the lower case x
but it didn’t work (I don’t know why).
So, I tried to use the substring function to select only the first 9 characters and it seems it worked.
This is the result:
Thank you again for your help guys. Much appreciated!
3 Likes
9 or 10 digits = seconds
12 or 13 digits = milliseconds
Fair warning that later dates have more seconds and it can also use an extra digit, so substring may not be the best.
The original variable, 13 digits, is the time in milliseconds, so lowercase x should be correct.
Alternatively, you can divide the number by 1000 and use uppercase X.
samliew – request private consultation
Join the unofficial Make Discord server to chat with us!
1 Like
Hey @samliew, that’s a good point. I updated the formula following your advice. Thank you!
Now it would be nice to understand why the lowercase x
doesn’t work, but this is another thing.
Thanks again!
1 Like