--- title: "MINSDIFF(A,B)" slug: "datetimetransform-template-3" updated: 2021-11-11T17:02:04Z published: 2021-11-11T17:02:04Z canonical: "docs.datajet.app/datetimetransform-template-3" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # MINSDIFF(A,B) ## DateTime Transform: MINSDIFF(A,B) ## Returns difference in minutes between Time for DateTime A and Time for DateTime B MINSDIFF(A,B) = AbsoluteMinutes(B) - AbsoluteMinutes(A) Where - AbsoluteMinutes(B) = number of minutes from date reference (where date reference = Jan 0, 0000) to B - AbsoluteMinutes(A) = number of minutes from date reference (where date reference = Jan 0, 0000) to A ## Purpose Use this function to: - Calculate time between events down to the minute - Calculate the age of an event in minutes ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Med / High | | **DataType** | Discrete / Continuous | | **DataSize** | Short / Integer | ```shell Example Return Value: -N....N where N = maximum difference in minutes between A and B ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DT_MINSDIFF_Sample.PNG) ## Parameters | Parameter | JSON | Description | | --- | --- | --- | | **Table** | “targetTable”: “MyTableName” | The target table on which the new field will be created | | **Filter** | “dataset”: {DataSet_JSON} | Optional. If a filter is applied, records not in the filter Recordset will be returned as null. | | **DateTime Function** | “p1”: “MINSDIFF(A,B)” | MINSDIFF(A,B) | | **A** | “p2”: “DateTimeFieldName” “p2”: “#YYYY-MM-DD HH:MM:SS” | Required. DateTime Value for A *Supports:* - **DataType:** Continuous - **Field Type:** DateTime - **Fixed Value:** #YYYY-MM-DD HH:MM:SS, e.g. #2021-04-05 11:01:08 | | **B** | “p3”: “DateTimeFieldName” “p3”: “#YYYY-MM-DD HH:MM:SS” | Required. DateTime Value for B *Supports:* - **DataType:** Continuous - **Field Type:** DateTime - **Fixed Value:** #YYYY-MM-DD HH:MM:SS, e.g. #2021-04-05 11:01:08 | ## JSON Sample ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DT_MINSDIFF_JSON.PNG) ## Usage Notes {Insert Notes Here} ## Example | Example | Details | | --- | --- | | **Description** | Calculate number of minutes between purchase and shipping | | **Input** | - Table: = [transactions] - Function: = DateTimeTransform - **DateTimeFunction: = MINSDIFF(A,B)** - A:= [transactions].[dtPurchase] - B: = [transactions].[dtShipping] - Name: =ShippingTime_Mins | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DT_MINSDIFF_Example.PNG) |