Time Duration Calculation

Viewing 2 reply threads
  • Author
    Posts
  • May 3, 2022 at 8:01 AM #47209

    Chris Medeiros
    Participant

    Hi Everyone,

    My intent is to calculate the amount of time a person is asleep.

    I’ve created this Calculation Field:

    MINUTES(Retired;Wake Time) / 60

    The ‘Retired’ and ‘Take Time’ field types are Time.

    It gives me the expected result if the Retired value is 12:00 AM. However, if the Retired time is 11:59 PM or any PM time, the result is 0.

    Do I need to change the field types to ‘Date & Time’ or somehow work with military time?

    May 5, 2022 at 9:25 PM #47218

    Brendan
    Keymaster

    Hi Chris,

    Yes, you should use a Date and Time field for this purpose. Because times can cross the midnight hour then. When you use Time, the date associated with it is always January 1, 1970 (the default Unix Epoch start time).

    You can also use the HOURS() function without having to divide by 60.

    Thanks,

    Brendan

    May 5, 2022 at 9:31 PM #47220

    Chris Medeiros
    Participant

    Hi Brendan,

    As always, thanks for your kind support.

    –Chris

Viewing 2 reply threads

You must be logged in to reply to this topic.