playMaker

Author Topic: Countup even when the phone is turned off  (Read 993 times)

amoraleite

  • Playmaker Newbie
  • *
  • Posts: 17
Countup even when the phone is turned off
« on: January 13, 2020, 09:38:53 AM »
I don't think is it possible --> Countup even when the phone is turned off

But I know that I can get the exactly date and time with the action : Get System Date Time

you guys can imagine a formula to use this info and add an integer each passes 10 minutes.

Eg:
01. Actual time 10:00 and pass 10 minute, are 10:10 = add +1 int

02. Other case,
Shutdown the system or app.
When you startap again:
The actual time pass more 120 minutes, and now are 12:10.
What formula I can use to add my integers?
10 minutes pass 11 times.
I need add 11 Int

Clear?

Thank you for your time!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Countup even when the phone is turned off
« Reply #1 on: January 14, 2020, 03:24:15 AM »
Hi,

 you need to use the mod ( modulo) operator.

https://csharp-station.com/how-to-test-for-even-or-odd-numbers-in-c/

there is an action floatModulo for that.

Bye,

 Jean

amoraleite

  • Playmaker Newbie
  • *
  • Posts: 17
Re: Countup even when the phone is turned off
« Reply #2 on: January 14, 2020, 06:05:00 AM »
Hi Jean!
Thank you for your reply.

Mate, I tested the action, but the other action (get system date) give to me a string.
like this: 10:30:23 or hh:mm:ss. How can I extract the diference between two times?

Best!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Countup even when the phone is turned off
« Reply #3 on: January 14, 2020, 11:20:52 AM »
Hi,

 you use timespan actions, on the ecosystem like "GetTimeSpanBetweenDates" action.

 Bye,

 Jean