> For the complete documentation index, see [llms.txt](https://documentation.astera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.astera.com/functions/date-time-with-offset/todatetimeoffsetfromdatetime-datetime-string.md).

# ToDateTimeOffsetFromDateTime (dateTime String)

| **Name**    | ***ToDateTimeOffsetFromDateTime***                                                                                                                                                            |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax      | ToDateTimeOffsetFromDateTime (String dateTimeString, String offsetString)                                                                                                                     |
| Purpose     | To return date time with offset value after conversion.                                                                                                                                       |
| Description | Converts specified date time value to a date time with offset value.                                                                                                                          |
| Return Type | DateTimeOffset                                                                                                                                                                                |
| Parameters  | <p>dateTimeString \[System.String] – Date string which will be converted to datetime with offset</p><p>offsetString \[System.String] – Offset which will be added to datetime with offset</p> |

![](/files/MjQfGQGX6h9YGds43dOQ)

**Example**

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

Where,

*dateTimeString* = 2009 10 AUG 05:09:17 PM

*offsetString* = 10:00

![](/files/zvOCQGOo1qVke9WRKxx1)

In the output window, you can see that the provided date time string value has been converted to a date time offset value, of the specified *offsetString* value.

![](/files/c85vgz4RIbCzlgxvX6VX)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://documentation.astera.com/functions/date-time-with-offset/todatetimeoffsetfromdatetime-datetime-string.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
