# How to change string in to datetime type?

**URL:** <https://community.neo4j.com/t/how-to-change-string-in-to-datetime-type/10824>\
**Category:** Import / Export\
**Tags:** import\
**Created:** [October 10, 2019, 1:47am UTC](https://community.neo4j.com/t/how-to-change-string-in-to-datetime-type/10824 "2019-10-10T01:47:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liuxinyi2323](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/liuxinyi2323/32/6810_2.png) [@liuxinyi2323](https://community.neo4j.com/u/liuxinyi2323)\
**Post date:** [October 10, 2019, 1:47am UTC](https://community.neo4j.com/t/how-to-change-string-in-to-datetime-type/10824/1 "2019-10-10T01:47:12Z")

</div>

when i import CSV file into neo4j browser,there is a row called CreationDate. it has a different type of date format. so i use python to convert them into the same format. the python code is below:

![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/1/171a7b7f9a905bba146f5a92c05028a830b3969b.png)

however, i want this CreationDate data can be calculate in the neo4j, so when i import the final file into neo4j, use DateTime type but there always errors:

![36](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/2/2877efd2740d4f2c7bd110a2eca8e20d7f59ec29.png)

how can i change string type into DateTime type?  
or how can i import appropriate format so that i can calculate easily

---

<div class="post-metadata">

**Author:** ![andrew\_bowman](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/andrew_bowman/32/73_2.png) [@andrew\_bowman](https://community.neo4j.com/u/andrew_bowman)\
**Post date:** [October 14, 2019, 8:16pm UTC](https://community.neo4j.com/t/how-to-change-string-in-to-datetime-type/10824/2 "2019-10-14T20:16:00Z")

</div>

You don't need the brackets around `{row.CreationDate}`, as Cypher is interpreting this as a map literal, or as parameter access. Just use `row.CreationDate` without brackets.

---

<div class="post-metadata">

**Author:** ![marksnelson09](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/marksnelson09/32/3913_2.png) [@marksnelson09](https://community.neo4j.com/u/marksnelson09)\
**Post date:** [April 7, 2020, 1:42pm UTC](https://community.neo4j.com/t/how-to-change-string-in-to-datetime-type/10824/3 "2020-04-07T13:42:55Z")

</div>

What's worked for me is this:

```auto
datetime({epochMillis:apoc.date.parse(row['end date'],'ms', 'dd/MM/yyyy')})

```

Using a combination of the datetime() function and the apoc.date.parse() function.
