> For the complete documentation index, see [llms.txt](https://200ok.gitbook.io/200ok-documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://200ok.gitbook.io/200ok-documents/user-manual/built-in-functions/date-and-time/todatetime.md).

# toDateTime

toDateTime() function is the Standard function available in 200OK.

**Description** : The toDateTime function converts the input date and time into the specified format.

**Syntax** : fx\_toDateTime(dd-mm-yyyy hh:mm:ss,dd-MM-yyyy HH:mm:ss)

**Example** : fx\_toDateTime(15-02-2022 17:41:25,dd-MM-yyyy HH:mm:ss) returns "2022-02-16T01:41:25.000Z", indicating the updated date and time formatted according to the specified format.

Here we go with simple scenario using the above function.

**Scenario** : In a logistics system, users convert timestamps into 'yyyy-MM-ddTHH:mm:ss.000Z' format for consistent event logging. They use a function to update timestamps, ensuring data integrity. For example, converting '15-02-2022 17:41:25' to 'yyyy-MM-dd HH:mm:ss' returns '2022-02-16T01:41:25.000Z'.

**Request Side** :&#x20;

<figure><img src="https://lh7-us.googleusercontent.com/9F7pk3Bose4cxxzSQLIhz3cWaWmYnX6g4kjfKbPur6eqzr1rqpwM234Py0GizgdtHBbjY5YKIcibhiOFMOdMN1h0TS3nTy1KDDFZrRktfX8zBaaax2KIDCCmJp0z8kWIN1RpMZY50r3Kbdes-mPp5Kc" alt=""><figcaption></figcaption></figure>

**Response Side** :&#x20;

<figure><img src="https://lh7-us.googleusercontent.com/wV9lDrcRUBIp5zcYZSOVAI9DTodqtdm956tHbtYCgdKkQ3jEynEymwvnVtAmUXUcq2tbzMnU6bHXxhrkXY0ooxwKAsQF4k0t1gmXzp7Xjdl7A1UE2HbY2_3RRbC6whNRCekU50QwaR5p9uTyiiemyjc" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-us.googleusercontent.com/WLYGW3VsBXFcmHcKVHKDQ-ZU3XvyskpDWvKXHiwrmhu4sgOH_ciyePB0mIYx8KZxwTJeKGXVP-lGGi_9QQ1WKLHNXIQLXFp4iNl2m8drxV3-GEsslaH0ziC7ieSP5cMlpZrEPZHr3B2WF5AMSo-S2pQ" alt=""><figcaption></figcaption></figure>
