Convert Unix Timestamp


1 Like


Yes the timestamp is in the requested API ( which I should be doing, this thing actually works.

To clear why im doing this.

Look here for my build:

i want the XX Minutes ago implemented, like here

i tried some as you tell but i get always 20

any kind of idea what i can do?

Do you want this?

This gives
as result

Change mediantime to timestamp if that is the time you want.

this wont work on my build.

for example:

i want listed the blocks with XX Minutes ago

i have only this api with this timestamps for this event.

Why wouldn't it work?

What does that mean. Isn't that what i showed you?

Do you want it look like
10 minutes
25 minutes
32 minutes
55 minutes

So, for me work this now. But i have the normal time like 22:02:17
but i need the minutes ago from the current time ^^


Idk i get this error:

Read this (especially point 2 and 3):

1 Like

Actually, i need the unix format epoch timestamp in seconds, how can i get it in App Inventor? Thanks.

You should check Clock blocks. . Convert to minutes and then divide minutes by 60.

A Unix Epoch is already in seconds; Epoch, also known as Unix timestamps, is the number of seconds (not milliseconds!) that have elapsed since January 1, 1970 at 00:00:00 GMT (1970-01-01 00:00:00 GMT).

1 Like

but how do you get it, no such function there?

Have you tried dividing the ( as milliseconds) by 1000 ? (to get seconds)

1 Like

is it that simple :laughing: ? tried, cannot be divided by 1000. tried format it using pattern"S", not sure that's the right way.

convert instant to millis then divide by 1000

like this?

I got it, using component_method

For any avoidance of doubt:

1 Like

This works

Hours 10 is the +10 GMT for me

Unix Timestamp can go directly in to "second" then add the offset 1970/1/1 and your Time Zone ( +10 for me)