Day count up when day changes 00:00

Hello,

I want to show the users how many days they use my app.
Now I have this code, but this code works based on time that the user press start button.
If user press the button at 15:00 today, the day number counts up at 15:00 tomorrow.

I want to count up the day when day changes 00:00.
I still can’t solve this problem several days.

plz help me

1 Like

Since kodular doesn’t work in background you need to open your app to execute your app and to solve your start button problem use screen initialize block instead of “START” click block

Do you want to show like " Joined 2 days ago"?

yes

If the user start this app and press start button today - day1
tomorrow - day2
.
.
.

ohh then use a tinydb component when user press start button store the date in tinydb tag

I suggest another idea. When the user presses the button (on first start), save into tyni db the date and into other tyni db value 1. If the user press the button read the date into tyni db, if is the same do nothing, but if this is higher store tyni db value + 1 and save into tyni db the new date

initialize

This is initialize code.
Everyting works fine but I just want to change the day count number when 00:00.

If yes then you can use these blocks

blocks (3)

As i mentioned earlier kodular doesn’t work in background you’ll need to open your app at 00:00 and if you are fine with this then use the clock componet to check current time when screen initializes …if time is 00:00 then start timer

Is there any way to put the time when user presses start button that format ?

Use “call clock now” block from clock component on button click. Then store the value in tinydb

I made my app by storing registered time as given format in database. And inserted that value in make instant parameters.