The DiffMinutes function is a built-in function that returns the difference in minutes between dt1 and dt2; i.e. how many minutes have passed between these two dates. Returns a positive number if dt1 is smaller than dt2; and returns a negative number if dt1 is bigger than dt2.

The DiffMinutes function behaves differently depending on the application server you are using because Daylight Saving Time (DST) is considered in the J2EE server while in the .NET server DST is ignored. Note that the time zone considered for evaluating this function is always the time zone of the Platform Server, regardless of the regional setting of the end-user desktop. The DiffDays, DiffHours and DiffSeconds functions also behave like this function.

Input parameters

dt1: Date Time  Type

dt2: Date Time Type

Output parameters

Integer Type

Examples

Usage

Result

DiffMinutes( #1982-05-21 22:20:30#, #1982-05-21 22:26:00# ) 6
DiffMinutes( #1982-05-21 22:26:00#, #1982-05-21 22:20:30# ) -6
DiffMinutes( #1982-05-21 22:26:00#, #1982-05-21 22:26:59# ) 0

DiffMinutes( #1982-05-21 22:26:30#, #1982-05-21 22:27:20# )

1
DiffMinutes( #1982-05-21 22:26:30#, #1982-05-21 22:27:40# ) 1

DiffMinutes( #2006-05-21 15:00:00#, #2006-05-22 15:00:00# )

1440

DiffMinutes( #2006-03-25 15:00:00#, #2006-03-26 15:00:00# )

1440 (in a .NET application server) or 1380 (in a J2EE application server), assuming the GMT + 1hour time zone. If your server is in a different time zone, you will get different results.

Note that 2006 Daylight Saving Time starts in Europe on March 26 of 2006.

DiffMinutes (#2006-10-28 15:00:00#, #2006-10-29 15:00:00#)

 

1440 (in a .NET application server) or 1500 (in a J2EE application server), assuming the GMT + 1hour time zone. If your server is in a different time zone, you will get different results.

Note that 2006 Daylight Saving Time ends in Europe on October 29 of 2006.

Remarks

When using this function you must be aware that the maximum value supported by Service Studio is (2 ^ 31) -1 minutes, which corresponds to approximately 4082.98 years.

If DiffMinutes (dt1, dt2) is bigger than 2147483647, you will get an unexpected value.

See Also

Available Data and Time Functions | Available Built-in Functions