Calculating with Date/Time Information

In the LDB you can perform calculations with date and time data to determine differences, add days, integrate times, convert seconds into time formats, and convert timestamps. This includes 'From-To' calculations for date differences, adding a specific number of days to a date, combining dates with times for calculations, converting seconds into hh:mm:ss format, adding minutes to an existing time, and converting dates to Unix timestamps for computational purposes.

If you set Parameter data types to date and time, you can select a date from the calendar or enter times. You can also perform calculations with these entries.

1. From - To - Calculations

You can express the difference between two dates in days, hours, minutes, or seconds.

Subtract the dates from each other and divide the result obtained in seconds by 24 (h/day), 60 (min/h) and 60 (sec/min).

(this(1)-this(0))/24/60/60

Subtrahieren Sie die Daten voneinander und teilen das in Sekunden erhaltene Ergebnis durch 60 (min/h) und 60 (sek/min).

(this(1)-this(0))/60/60

Notes:
LDB internally stores each date as Unix time in seconds.
With the function this(0), you directly access the value of column 0 of the parameter where this formula is also located.
See Deposit formulas with parameters (Parameter-internal calculations)

Die Formel dauerformat(this(1)-this(0)) liefert das Ergebnis direkt in Tagen (und ggf. Stunden, falls gewünscht und falls Übergang in Sommer, Winterzeit).
Bitte berücksichtigen Sie bei der Darstellung der Dauerberechnung die Umstellung von Sommerzeit und Winterzeit.

dauerformat(this(1)-this(0))

2. Adding a desired number of days to a date

Format the obtained result back into a date field with datum('d.m.y', this(x)).

datum('d.m.y', this(0)+this(1)*24*60*60)

3. Integrating times
With the function dateplustime(Datum,Uhrzeit), you can link a date with a time and perform calculations.

Um das Startdatum mit der Startuhrzeit zu verknüpfen wird dateplustime((this(0),this(1))erstellt.
Um die Differenz zwischen Startdatum/-zeit und Enddatum/-zeit zu berechnen wird mit dateplustime das Startdatum/-zeit von dem Enddatum/-zeit abgezogen und in Stunden ausgegeben.

(dateplustime(this(2), this(3)) - dateplustime(this(0), this(1)))/60/60

Um die Differenz zwischen Startdatum/-zeit und Enddatum/-zeit in Tagen auszugeben wird zusätzlich das dauerformat verwendet.

dauerformat(dateplustime(this(2), this(3)) - dateplustime(this(0), this(1)))

4. Converting times from seconds to minutes and seconds

With the following function, a time in seconds is converted into the time format (hh:mm:ss):
e.g.: 70 seconds:
formatsekundenalszeit(70) results in 00:01:10

5. Adding a number of minutes to an entered time

With the following formula, 30 minutes are added to an entered time.
So 8:00 becomes 8:30 or 13:45 becomes 14:15.

datum('d.m.Y G:i', dateplustime(Datum,Uhrzeit)+30*60)

See data type time: Parameter data types

6. Converting a date to Unix timestamp

With the following formula, a date in the format Y-m-d G:i:s can be converted into a Unix timestamp. This is necessary for calculations with dates.

unixtime(Datum)


Related Topics:

Laatste wijziging: 21.08.2026

Algemeen

Leveranciersbeoordeling

Materiaal

Medewerkers

Klanten

Opdrachten

Monsters

PDF-sjablonen

Bijlagen

Recepten

Verslagen

Editor voor rapporttabellen

Interfaces

Kompetenzen

AI-functies

Inleidende fase

Analyses

Sjablonen

Klantenportaal (optioneel)

Aanbiedingen

Facturen

Parameters

Rekenwerk met parameters

Webservices

Transformatiecode

Controleplannen / Grenswaarden / Specificaties

Documentbeheer

Vragen en antwoorden

Testmiddelen

Opleidingen voor medewerkers

8D-rapport

Overige

Bestandsbeheer

Processen