How to create 10 digit UNIX timestamp?

How do I drop the ms from a UNIX time stamp?

I’m using the sendgrid API which only accepts 10 digit UNIX time. Bubble as current/date_time is 13 digits long. I need to drop the ms.

Ex. Send 1516796696 instead of this 1516796696115

Hey @kramwe,

You can use the :extract module on a date to get a number-type UNIX timestamp. :slight_smile:

1 Like

Thanks. Do you know if I need to extract all the pieces separate?

For example, does this give me UNIX down to the minute? Or only minutes?
image

Also, I don’t see seconds…

1 Like

The last option is what you’re looking for, the UNIX timestamp (ms). Since it’s a number type, you can do any math operations you’d like and use :formatted as to make things match your use case.

1 Like

Still cannot get it to work. Formatted as doesn’t give me the option to truncate the milliseconds.

This for example, adds .000 to the end of the 13 digits. Do you see another way?

This should have been so easy… but this is what I came up with.

image

Get UNIX with ms. Divide by 1000. Round to 0th place.

1 Like

Exactly, that’s what the math operations are for. :wink:

My brain, having avoided math, thanks you.

1 Like