How to disable button on between some hours

Hello creators
I want make a button is only visible between 08:00 and 17:00 ,how can i do this?

Use this to convert it to milliseconds:

Grab the clock and the Clock.System block to get the system milliseconds, then check if it’s larger than your set milliseconds. If it’s larger, enable the buttons, if not then disable them.

İt will be hidden every day same hours.If i m not missunderstanding i cant do with this.

So look at the difference between days in Milliseconds:

969803100000 - 969716700000 = [1] day(s)

So, if 969716700000 has been reached then set if (var = 969803100000) { //action(s) }.

So this means, every day try adding 86400000 to their current amount of milliseconds, I’ll have to test something that does this but, that should give you an idea of what you could do.

What about something like this, just to show the logic of formating the time and doing some if or. Place it how and where you like.

The OR in there should be an AND

6 Likes

its working thanks but when time is 13:00 it shows 01:00 and so clock not working.
How can i change to 24h format?

Use this

image

It returns the current hour in 24h format A number between 0 - 23

2 Likes

Thanks bro,working now.:star_struck:

Please tick the solution button so it is easier for others to search for answers, knowing it has been solved.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.