Count no of days from the last used date

I want the app to count no of days that has been passed from last used time according to Indian Standard Time

See here

for an idea of how to use the clock duration blocks

:-1: you didnt get my question
I want to my app to count days passed from the day app was last used

The above code is exactly what you'll need ! instead of picking the date as shown above , you should store the instant at which you're quitting app and then perform the action in Button2.Click on app start (i.e screen.initialise)

If you are not even able to ask precise questions, you should be at least a little polite.

1 Like

Clock1.SystemTime is good for this, along with a TinyDB tag LAST_USED_MS.

In Screen1.Initialize event
   set local ms_from_last_run to (Clock1.SystemTime - get TinyDB1 tag default Clock1.SystemTime)
   set global days_from_last_run to floor ( ms_from_last_run / ms_per_day)
   save in TinyDB1 tag LAST_USED_MS value Clock1.SystemTime

Thanks for help

Can you show this in form of blocks it will be more helpful for beginners like me

I dont want to store the instamts manually be seelcting date it should be dkne automatically

last_run_days.aia (2.1 KB)

1 Like

Show us your blocks

Please download and post each of those event block(s)/procedures here ...
(sample video)

Compare your TinyDB1 value if not there with mine.
I rigged it especially to handle the first use.

Does the tag value should be same as yours

The tag can be different from mine.

The value has to be the same as mine,

But i used same blocks as yours why its not working

I marked the difference for you ...
In programming, little details make for big differences.

thank you verrryyyyyyyy muchhhhhhhhhh

This is in the wrong thread, but I won't bother chasing it down.

There is a Show Feedback option for buttons in their attributes.
if turning it off does not help, you have run out of blocks-only approaches.

However, as a workaround, sprites on Canvases don't make noise.