my daily counter app premise is 2 blocks one in screen1 that checks if the app is used for the first time if so stores the time tag, then the second block measures the duration between that time the app is first used and now.
It can’t find your tag in TinyDb, so it reads by default what you wrote in your “value if no tag there”. So it can’t laucnh a clock duration block with your first date that is “error”.
As ontstudio said, look at the error
It said “the Duration (block) cannot accept Error and May 23, 2020”
That’s mean it returned value is not There string.
Have you checked if you saved any thing in tinyDB in the tag of isitfirsttime?
If you didn’t, this error would occur in your case.
now i am having this error argument to MakeInstant should have form MM/dd/YYYY hh:mm:ss, or MM/dd/YYYY or hh:mm
Note: You will not see another error reported for 5 seconds.
I made this app to test-simplify the duration tool before using it in my app. I tried using the format date first but i got this error message, hence why i tried the instant tool. the duration tool seems to refuse to work with every form i try.
Can you tell me what are trying to obtain?
The duration from when to when?
Clock component: Duration
From the Kodular documentation, we can see that you’ll need an instant, but you have used the format date (which will return a string, not an instant)
Therefore, if you want to use the text block, you’ll need to use make instant Clock component: Make Instant
Only the string in MM/dd/YYYY hh:mm:ss or MM/dd/YYYY or hh:mm is accepted.
Try this, this must work. I found that no matter u use format date time or format date it’s fine
Label 3 should be 0, because the duration is from now to now
If you want to make some modifications, for example you already have the string/text with the format of MM/dd/YYYY hh:mm:ss or MM/dd/YYYY or hh:mm, you may do this.