# Convert Time string to Datetime format

**URL:** <https://forum.uipath.com/t/convert-time-string-to-datetime-format/368757>\
**Category:** Robot\
**Tags:** date, datetime, format, question, system, activities\
**Created:** [December 10, 2021, 10:42am UTC](https://forum.uipath.com/t/convert-time-string-to-datetime-format/368757 "2021-12-10T10:42:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomnguyen795](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/tomnguyen795/32/263305_2.png) [@tomnguyen795](https://forum.uipath.com/u/tomnguyen795)\
**Post date:** [December 10, 2021, 10:42am UTC](https://forum.uipath.com/t/convert-time-string-to-datetime-format/368757/1 "2021-12-10T10:42:45Z")

</div>

Hi all, currently I am importing data from a Jason string output. In the data, there is a datetime string which looks like this: “Fri Dec 03 06:22:00 UTC 2021”. I am struggling to convert it to the date time format as “dd MMM yyyy HH:mm:ss”. I have tried parse but UiPath gave me error: “string is not regconized as a valid date time”. After the conversion, I need to compare it to the datetime I have in another format with the required format so converting it to string or date time is okay for me as long as it is in the same format “dd MMM yyyy HH:mm:ss”. Appreciate all suggestions. Thank you.

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [December 10, 2021, 10:48am UTC](https://forum.uipath.com/t/convert-time-string-to-datetime-format/368757/2 "2021-12-10T10:48:31Z")

</div>

> [@tomnguyen795](#):
>
> Fri Dec 03 06:22:00 UTC 2021

@tomnguyen795  
Welcome to the forum

 ![grafik](https://global.discourse-cdn.com/uipath/original/4X/7/a/a/7aad1f340430cc4044ced0fb1206735d7d5c9e21.png)

---

<div class="post-metadata">

**Author:** ![Srini84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/srini84/32/464032_2.png) [@Srini84](https://forum.uipath.com/u/Srini84)\
**Post date:** [December 10, 2021, 10:49am UTC](https://forum.uipath.com/t/convert-time-string-to-datetime-format/368757/3 "2021-12-10T10:49:23Z")

</div>

@tomnguyen795

Welcome to forums

Check below for your reference  
[Link](https://youtu.be/h9pAsRS6hmc)

Thanks

---

<div class="post-metadata">

**Author:** ![tomnguyen795](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/tomnguyen795/32/263305_2.png) [@tomnguyen795](https://forum.uipath.com/u/tomnguyen795)\
**Post date:** [December 10, 2021, 11:05am UTC](https://forum.uipath.com/t/convert-time-string-to-datetime-format/368757/4 "2021-12-10T11:05:25Z")

</div>

Thank you. It worked :smiley. My incorrect code was using DDD instead of ddd.
