How to shorten the UNIX number?

I’m doing something relatively simple but running into a question.

I’m simply converting the current date and time into a UNIX timestamp using the EXTRACT method.

For example:
Dec 14, 2022 8:41 am = 1671036060000

Bubble creates a 13-digit number.
My API call only works with using the first 10 digits of this number (1671036060).

There is no “characters until” type of method to capture just the first 10 digits. Is there an easy way to grab just the first 10 digits so I can drop it into a Custom State?

Thanks,
Dan

Hi there, @underhill.dan… can you use the :truncated to operator?

Best…
Mike

Thanks, but I don’t get :truncated as an option because the type of data is a number and not text.

If it’s a number then just divide it by 1000 (and round to zero)

1 Like

If it helps, here is an example where an integer input is being truncated (I didn’t change any of the default formatted as settings).

truncate

Of course, I need more coffee! This is the easiest solution.

Thanks @adamhholmes !

This topic was automatically closed after 70 days. New replies are no longer allowed.