# 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://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fiox0OOAHmZSVUXizOeIc%2F0.png?alt=media)

**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://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FnSEDiyMPxdjJ33iUvMIm%2F1.png?alt=media" 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://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fc8hMI7HFBrRQLv3Dt8ti%2F2.png?alt=media" alt=""><figcaption></figcaption></figure>
