--- title: "SOD(A)" slug: "datetimetransform-template-7" updated: 2021-11-16T12:21:59Z published: 2021-11-16T12:21:59Z canonical: "docs.datajet.app/datetimetransform-template-7" --- > ## 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. # SOD(A) ## DateTime Transform: SOD(A) ## Returns the number of seconds since the start of the day in DateTime A ## Purpose Use this function to: - Calculate the number of elapsed seconds since the start of the day ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Med | | **DataType** | Discrete | | **DataSize** | Short | ```shell Example Return Value: 0 to 85399 ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DT_SOD_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”: “SOD(A)” | SOD(A) | | **A** | “p2”: “DateTimeFieldName” “p2”: “#YYYY-MM-DD HH:MM:SS” | Required. The Datetime string from which to calculate seconds of the day. *Supports:* - **DataType:** Discrete / 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_SOD_JSON.PNG) ## Usage Notes To return the second digits of DateTime field A, use the SECOND(A) function. See Also - HOD(A)  (DateTime) - MOD(A)  (DateTime) - Engineering | Expression Field ## Example | Example | Details | | --- | --- | | **Description** | Calculate number of seconds since the start of the day that purchase occurred | | **Input** | - Table: = [transactions] - Function: = DateTimeTransform - **DateTimeFunction: = SOD(A)** - A:= [transactions].[dtPurchase] - Name: =SOD_A | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DT_SOD_Example.png) |