Showing Unix Time

Hello,
I have a clock timer and a text label. What I would like to do is display the UNIX time in the text label every time the clock fires (i.e. every 1 second) but I can't figure out how to do that. Does any one have any ideas?

Thank you!!!!

Unix in seconds or as something else. You might read this thread that discusses UNIX time with App Inventor Tom.

I just wanted to see the UNIX time in seconds - ie: 1659979806

Please have a look into Convert Unix Timestamp - #4 by Anke this

Here is how you convert local time to UNIX time using python: How to Convert DateTime to UNIX Timestamp in Python ? - GeeksforGeeks

You might be able to do something similar with Blocks.

Else get current milli using clock component and divide it by 1000


Thank you for your help thus far. Right now I have this and it works except that it displays the time as "1.66E9" and I can't find a way to show the whole number.

To avoid scientific notation on the output, use the FormatDecimal math block with 0 digits fractional part.

Can you tell me where to find this block? I can't find it anywhere.

math_format_as_decimal
(This can be dragged directly into your Blocks Editor workspace)

Thanks for your help @ABG and thanks for the block. Can I ask where you found it? I couldn't find it anywhere.
Capture

You should be able to scroll down in each pallete.


Capture

image

Ok, thank you. It's strange but all of those extra functions just aren't there, in this project anyways. I tried creating a new project and they are there for the new project. Strange but I can work with that.

Your missing blocks might be due to a Screen1 setting left over from a tutorial project.

Look for the Screen1 Designer setting that restricts which blocks can be shown.

Thank you, that was it!