Effacer les filtres
Effacer les filtres

How to calculate time duration between two date app designer

7 vues (au cours des 30 derniers jours)
Amartuvshin
Amartuvshin le 5 Fév 2024
Modifié(e) : Pratik le 5 Fév 2024
put 2 date interval hour/minute/sec/dd/mm/yyyy and need calculate duration period on app designer

Réponse acceptée

Pratik
Pratik le 5 Fév 2024
Hi Amartuvshin,
As per my understanding, in App Designer you want to take input two date interval and calculate the duration between them.
In MATLAB App Designer, you can calculate the time duration between two dates by using the datetime data type and the “between” function to compute the difference. First, you would typically have two “uidatepicker” components for the user to select the start and end dates. Then, you would have a Button that, when clicked, calculates the duration between the two dates and displays the result in a Label or any other UI component you prefer.
Please refer to the documentation of “between” for more information on calculating calendar math differences:
Please refer to the documentation of “uidatepicker” for more information on creating date picker component:
I hope this helps.
  2 commentaires
Amartuvshin
Amartuvshin le 5 Fév 2024
Hi sir
I am beginner that is may first task. I am transmission engineer.
now i cant add HH:MM:SS in datepicker and push calc buttom while need calculate duration time by format day:hour:sec.
Can you help how to change formats and calculate code?
Pratik
Pratik le 5 Fév 2024
Modifié(e) : Pratik le 5 Fév 2024
Hi Amartuvshin,
Taking HH:MM:SS directly from "uidatepicker" is not possible. As a workaround you can take the time input using text-based UI editfield.
Please refer to documentation of "uieditfield" for more information on creating text or numeric edit field component:
Please refer to this MATLAB Answers post which discusses about the same issue:

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by