# CharToSeconds (Str)

| **Name**    | ***CharToSeconds***                                                                                   |
| ----------- | ----------------------------------------------------------------------------------------------------- |
| Syntax      | CharToSeconds (String timestring)                                                                     |
| Purpose     | To compute the total number of seconds from the beginning of the day to the date time value provided. |
| Description | Parses a date time string and returns number of seconds since the beginning of the day.               |
| Return Type | Int32                                                                                                 |
| Parameter   | timestring \[System.String] – Datetime string to be converted into seconds                            |

![](https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/0%20\(100\).png)

**Example**

In this example, we will pass a date time string (*timestring*) value to the function transformation object using a *Variables* object.

Where,

*timestring* = 12:50:10

<figure><img src="https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/1%20(101).png" alt=""><figcaption></figcaption></figure>

In the output window, you can see that the provided *timestring* value has been used to compute the total number of seconds since the beginning of the day.

<figure><img src="https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/2%20(101).png" alt=""><figcaption></figcaption></figure>
