Calculating with Date/Time Information

In the Labordatenbank 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

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

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

Notes:
Labordatenbank 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)

The formula dauerformat(this(1)-this(0)) provides the result directly in days (and hours, if required and if transition to summer, winter time).
Please take the changeover from summer time to winter time into account when displaying the duration calculation.

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.

To link the start date with the start time, dateplustime(27.10.2019,10:30)is created. To calculate the difference between the start date/time and the end date/time, dateplustime is used to subtract the start date/time from the end date/time and output in hours.

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

The duration format is also used to display the difference between the start date/time and end date/time in days.

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)

Last change: 25.08.2025

Allgemeines

Einführungsphase

Auswertungen

Mitarbeiter

Aufträge

Proben

Probenvorlage

Berichte

Kunden

Berichtstabellen Editor

Kundenzone (optional)

Anlagen

Angebote

Rechnungen

Parameter

Rechnen mit Parametern

Schnittstellen

Webservice

Transformationscode

Prüfpläne / Grenzwerte / Spezifikationen

Dokumentenlenkung

Fragen und Antworten

Prüfmittel

Material

Mitarbeiterschulungen

8D-Report

Sonstiges

PDF-Vorlagen

Lieferantenbewertung

Dateiverwaltung

Prozesse