can you please say how to use that block im not a pro like anybody im just a one step above beginer
please try something... everything you need to know is explained in the documentation...
and if you get stuck, post a screenshot of your updated relevant blocks...
AddSeconds( instant , quantity )
Returns an instant in time some seconds after the given instant.
for example the instant in time could be the Clock.Now block and the quantity could be 10
Taifun
thank you im confused what should come at instant now i got cleared
what about trying something?
as already said
see also tip 2 here App Inventor: How to Learn | Pura Vida Apps
see also again the documentation to understand what is an instant...
Operations on dates and times, such as from
DatePicker
andTimePicker
, are accomplished through methods in Clock. Date and Time are represented as InstantInTime and Duration.
- Instant : consists of Year, Month, DayOfMnoth, Hour, Minute, and SEcond. An instant can be created using the
MakeInstant
,MakeInstantFromMillis
andMakeInstantFromParts
methods.- Duration : time in milliseconds elapsed between instants. Duration can be obtained by the
Duration
method.Instants are assumed to be in the device’s local time zone. When they are converted to or from milliseconds, the milliseconds for a given Instance are calculated from January 1, 1970 in UTC (Greenwich Mean Time).
Taifun
i know how to use that block the thing is i dont to use in that case..
if you know please tell me
hi! can you say me the solution for my problem I already asked but i didnt get proper answer from the article you sent..my problem is when the user clicks the start button the stopwatch should run it is running perfectly and for example its 10 seconds there will be a number keypad layout which has 1,2,3,4 etc numbers buttons on it so when the user clicks on number 1 button 1 second should be added to the stopwatch like if it is 10 seconds immediately when the user taps the number button it should show 11 seconds and continue like that and when the user presses the number 5 button 5 seconds should be added to stopwatch seconds..
FOR PICS REFER THE POST HOW TO ADDING SECONDS TO A STOPWATCH WHILE ITS RUNNING
what have you tried?
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
you can see the pics in my post"how to add seconds in running stopwatch"
up to now unfortunately you did not try anything...
you might want to use the AddSeconds method as already mentioned and provide an updated screenshot of your blocks...
Taifun
i tried myself it is adding thnx!
great to hear
please provide the solution to the problem then…
this community is to help each other…
and your answer can help others with the same issue in future… thank you…
Taifun
but i have a problem in that when ever i click those buttons it is adding but after a second it returns back to the orginal time
see this video
Show your blocks.
in the button click blocks i didnt take a snap of two other button but the function are the same as button N1 and like..
and variable (k1 to k10) it is intialized as blank
Regarding the resetting problem, that stems from the data flow.
The data flows from global start_time, and everything downwards in the Clock Timer derives from that.
So that's what you should adjust:
To add to your time, move the start_time back in time by adding a negative duration to it.
@Anke yes this is the thing i want can you say instead of 3 buttons(5,8,10) how to keep 10 buttons(1 to 10)..also in designer page only a label , start btn , stp btn , numbers btn and only clock component in needed right or anything should be added?
by the way thanks for solving my problem
will this program work for resetting the time?
(eli ) is a button i made just for another purpose in my program
(time label) this the lable where time will run
(control) this is a table arrangement which has all the start , stop and reset buttons
(numpad) it is also a table arrangement in which number controls are there
textbox 1 and button 2 it is also for a different purpose in my program..
i cant get that call tformat1 . durationHour Mins sec from block
is that an extension?