Clickup time spent format

Through the ‘get task’ function we get data from a task including the ‘time spent’ field. However, a very large number is displayed here. Originally 4 hours are registered but a figure 14400000 appears in the data of Make. When I place this figure on another task in ClickUp it shows 240000:00:00 hours. How can I fix this?

1 Like

Hi Wim,

ClickUp sends time spent in milliseconds. You’ll have to use a formula to convert it to hours or minutes.

2 Likes

According to the Tokens you can use to parse a date variable, you can use x.

e.g.: parseDate(time_in_ms; x)

2 Likes

Yes specificially, these formulas will work:

(time_in_ms / 1000 / 3600) will get you the number of hours

(time_in_ms / 1000 / 60) will get you the number of minutes

3 Likes

Hi sam! Thanks for your input. But I got an error on this. Do you know what it can be?


Hi Alex! Thanks for your input. But I got an error on this. Do you know what it can be?


Is 4.time spent a number or a text string? I think it may be a text string so you’re need to parseNumber() on it first before putting it into the formula.

2 Likes

Hey Alex, could that be the cause? Because as I said… when I place only this figure as input it shows 240000:00:00 hours as a result in ClickUp. Or possibly the calculation fails because it is not a number? I want to try converting, like you said, but can you help me how to do this exactly in Make?

I think you used an uppercase X, which means something different

2 Likes

Hi Sam, I tried a small ‘x’…
Scherm­afbeelding 2024-02-07 om 08.23.54

but it gave the same error message: Invalid number in parameter ‘time’.

Welcome to the Make community! @dodder

That looks like a new question, could you please create a separate topic for this?

While it’s tempting to spam an existing thread, a more effective approach would be to start a new topic just for your question. It helps community experts find and respond to your query quicker, and keeps our space organised for everyone. If you start a new conversation you are also more likely to get help from other users. You can refer others back to a related topic by including that link in your question. Thank you for understanding and keeping our community neat and tidy.

The “New Topic” link can be found in the top-right of the header:

Screenshot_2023-12-19_091207

1 Like

I don’t think this is a new topic. Who would post a text ‘hello.jpg’ with a rather bizar url behind it?

This but without the brackets around it should work just fine. Make sure you set it to Time and to Minutes if you are using this formula.

Also just to clarify - parseDate() gives you a date, not time.

Here is how I set it up for a test and it worked:

3 Likes

Yes!! Thanks Stoyan!

1 Like