Question about adding minutes to a DateTime in AppSheet

Hi everyone,

I’m working with a DateTime column called [FechaHoraFin], which should be the result of [FechaHoraInicio] (DateTime) plus [TiempoCapacitacion] (Decimal, representing minutes).

When I test with fixed minutes (for example adding + "000:15:00"), it works correctly.

The issue comes when I try to replace that fixed value with the variable [TiempoCapacitacion]: I can’t get AppSheet to interpret it as a duration and add it to the DateTime.

EXAMPLE 1:

EXAMPLE 2:

EXAMPLE 3:

Has anyone run into the same issue and found a formula that correctly converts a number of minutes into a duration that can be added to a DateTime?

Thanks a lot for your help! :folded_hands:

There is no DURATION() function. Never has been.

To create a Duration value from a Text value, create a Time or DateTime value from the Text, then subtract a zero Time value:

(TIME("00:" & [TiempoCapacitacion] & ":00") - "00:00:00")

Note that AppSheet strictly requires seconds and minutes to each be whole numbers less than 60, so you might be better off with one of the following:

(TIME("00:" & NUMBER([TiempoCapacitacion]) & ":00") - "00:00:00")
(TIME("00:" & ROUND([TiempoCapacitacion]) & ":00") - "00:00:00")

See also:

3 Likes