# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.astera.com/astera-data-stack-v10/functions/date-time/chartoseconds-str.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
