Skip to main content
1-Visitor
October 4, 2020
Question

how to calculate downtime status using from date and end date.

  • October 4, 2020
  • 1 reply
  • 2100 views

Hi, Everyone

I want to calculate the downtime status which shows in below image,

I am creating a program that has 'from_date and 'to_date' and their program so I want to display time status which is shown in the below image.

use case.

  1. Want to show the time if the program will start in 5hours (ex.' start in 5 hr',4,3,2,1)
  2. then change the time when it's less than an hour(ex. 'start in 59 min',58,57, etc till 0)
  3. change the time status when it's less than a minute (ex. 'start in 59 sec',58,57, etc till 0)
  4. If the program will start, the status will 'ON'(ex.' ON-59 min remain')
  5. If the program time will end (ex, 'END'

Untitled.png

can you please help how can I do that,

1 reply

22-Sapphire I
October 5, 2020

I would say the best way to approach this is to generate the counter Server side - this does mean you need to know what time zone the user is in potentially.

A timer or scheduler runs and generates the appropriate number and using GetProperties push on update your information is pushed to the connected mashup.

Turning that around, you can use a Refresh timer on the mashup to call a service to get the latest number to display.

As a third option you might be able to do it with an expression as well 

Suraj26921-VisitorAuthor
1-Visitor
October 5, 2020
So I have to create a service or is there any option to create downtime
status from timer or scheduler.
If timer or schedular i used then how can I get the program start time and
end time.
Can you tell me any example?
22-Sapphire I
October 5, 2020

There isn't an OOTB countdown available.

So you have to calculate the time remaining from some initiating event.

You need to determine what you will use to start the countdown.

This could be the same scheduler/timer to check a calendar or a button on a mashup, or a change in information in the system.